Exceptions and their interpretation



Similar documents
15-214: Principles of Software Construction 8 th March 2012

Single page. Here is a single file with all the pages. There is also a pdf version.

Lecture J - Exceptions

public static void main(string args[]) { System.out.println( "f(0)=" + f(0));

Java Programming Language

- ' +. /0 ( 1 +. ' &+. /"0 &1,

Application Programming Interface

Java Card Application Programming Interface

Building Robots with NXT and LEJOS. Introduc<on. What is the NXT Robot Michael Wooldridge liv.ac.uk)

Java from a C perspective. Plan

RMI Client Application Programming Interface

Amazon Glacier. Developer Guide API Version

Third AP Edition. Object-Oriented Programming and Data Structures. Maria Litvin. Gary Litvin. Phillips Academy, Andover, Massachusetts

Designing with Exceptions. CSE219, Computer Science III Stony Brook University

B.Sc (Honours) - Software Development

Creating a Simple, Multithreaded Chat System with Java

ROBOTICS AND AUTONOMOUS SYSTEMS

Using Two-Dimensional Arrays

Java Virtual Machine Locks

Word count example Abdalrahman Alsaedi

JAVA - EXCEPTIONS. An exception can occur for many different reasons, below given are some scenarios where exception occurs.

Introduction to Java

Scanner. It takes input and splits it into a sequence of tokens. A token is a group of characters which form some unit.

Crash Course in Java

How to use IBM HeapAnalyzer to diagnose Java heap issues

Java Interview Questions and Answers

1) Which of the following is a constant, according to Java naming conventions? a. PI b. Test c. x d. radius

File class in Java. Scanner reminder. Files 10/19/2012. File Input and Output (Savitch, Chapter 10)

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

AVRO - SERIALIZATION

Introduction to Object-Oriented Programming

Langages Orientés Objet Java

Install Java Development Kit (JDK) 1.8

Overview of Web Services API

How to use the Eclipse IDE for Java Application Development

Chulalongkorn University International School of Engineering Department of Computer Engineering Computer Programming Lab.

Licensed for viewing only. Printing is prohibited. For hard copies, please purchase from

Programmation 2. Introduction à la programmation Java

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

Getting Started with the Internet Communications Engine

Running Hadoop on Windows CCNP Server

Networks and Services

Continuous Integration Part 2

Zebra and MapReduce. Table of contents. 1 Overview Hadoop MapReduce APIs Zebra MapReduce APIs Zebra MapReduce Examples...

AP Computer Science File Input with Scanner

5 HDFS - Hadoop Distributed System

Basic Java Constructs and Data Types Nuts and Bolts. Looking into Specific Differences and Enhancements in Java compared to C

Java: overview by example

Hello World RESTful web service tutorial

1 Hour, Closed Notes, Browser open to Java API docs is OK

Develop lejos Programs Step by Step

Using Eclipse to Run Java Programs

Java Programming Unit 1. Your first Java Program Eclipse IDE

Preet raj Core Java and Databases CS4PR. Time Allotted: 3 Hours. Final Exam: Total Possible Points 75

1001ICT Introduction To Programming Lecture Notes

AP Computer Science Static Methods, Strings, User Input

AP Computer Science Java Subset

CS 121 Intro to Programming:Java - Lecture 11 Announcements

Word Count Code using MR2 Classes and API

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

Jiří Tomeš. Nástroje pro vývoj a monitorování SW (NSWI026)

WRITING DATA TO A BINARY FILE

Hadoop Tutorial. General Instructions

STM32JAVA. Embedded Java Solutions for STM32

Copy the.jar file into the plugins/ subfolder of your Eclipse installation. (e.g., C:\Program Files\Eclipse\plugins)

LAB4 Making Classes and Objects

Hadoop Basics with InfoSphere BigInsights

Java Programming. Binnur Kurt Istanbul Technical University Computer Engineering Department. Java Programming. Version 0.0.

Java. Java. e=mc 2. composition

What are exceptions? Bad things happen occasionally

Elastic Map Reduce. Shadi Khalifa Database Systems Laboratory (DSL)

Introduction to Java. CS 3: Computer Programming in Java

D06 PROGRAMMING with JAVA

Software Development with UML and Java 2 SDJ I2, Spring 2010

Evaluation. Copy. Evaluation Copy. Chapter 7: Using JDBC with Spring. 1) A Simpler Approach ) The JdbcTemplate. Class...

ECE 122. Engineering Problem Solving with Java

Reach 4 million Unity developers

Konzepte objektorientierter Programmierung

IDS 561 Big data analytics Assignment 1

JDK 1.5 Updates for Introduction to Java Programming with SUN ONE Studio 4

Sophos Mobile Control Network Access Control interface guide

How to Install Java onto your system

Event-Driven Programming

Description: Maintenance review of the JDBC RowSets 1.0 Specification. Feedback: Comments should be sent to

Data Structures Lecture 1

Hadoop and Eclipse. Eclipse Hawaii User s Group May 26th, Seth Ladd

COSC Introduction to Computer Science I Section A, Summer Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

Object-Oriented Programming in Java

Interoperating with.net Beyond Web Services

Course Intro Instructor Intro Java Intro, Continued

Tutorial: Getting Started

Interoperating with.net Beyond Web Services

See the Developer s Getting Started Guide for an introduction to My Docs Online Secure File Delivery and how to use it programmatically.

Section 6 Spring 2013

SE 360 Advances in Software Development Object Oriented Development in Java. Polymorphism. Dr. Senem Kumova Metin

java.util.scanner Here are some of the many features of Scanner objects. Some Features of java.util.scanner

Chapter 2 Introduction to Java programming

CPLEX Tutorial Handout

SOLoist Automation of Class IDs Assignment

Step 4: Configure a new Hadoop server This perspective will add a new snap-in to your bottom pane (along with Problems and Tasks), like so:

Transcription:

Exceptions and their interpretation LeJOS supports most of the standard Java language exception classes, and users can also create their own exception classes. If a program throws an exception on the NXT, it is displayed on the LCD, since the NXT brick does not have a console/ screen. Hereby the exceptions, depending on the program, are assigned to specific error codes. Suppose our program ExArithmetic.java contains the following code: public class ExArithmetic { public static void main(string[] args) { int x = 1; int y = 0; int z = x/y; } } After uploading and starting this program, the LCD shows the following: Java Exception: Class: 10 Methode: 0 Every time the error codes are newly generated for every transfer of the program from your computer to the NXT. In order to display these error codes while uploading, you have to call nxj with the option verbose. This can be done either in the command line (nxj -verbose ExArithmeitic) or in Eclipse. For the latter go to Window -> Preferences -> lejos NXJ and mark the check-box Verbose. Then a list of different Classes and Signatures will appear in the console. Class represents the type of the thrown exception and Signature (it is displayed Methode on the LCD which is

equal to Signature) the method in which the exception has occurred. Note that the list of Classes and Signatures can differ from program to program (amount of listings and assignments) and therefore must be considered for examination of the error message. According to our example ExArithmetic.java there was thrown an ArithmeticException in the main method: C:\nxj -verbose ExArithmetic Linking... Class 0: java/lang/object Class 1: java/lang/thread Class 2: java/lang/string Class 3: java/lang/throwable Class 4: java/lang/error Class 5: java/lang/outofmemoryerror Class 6: java/lang/nosuchmethoderror Class 7: java/lang/stackoverflowerror Class 8: java/lang/nullpointerexception Class 9: java/lang/classcastexception Class 10: java/lang/arithmeticexception Class 11: java/lang/arrayindexoutofboundsexception Class 12: java/lang/illegalargumentexception Class 13: java/lang/interruptedexception Class 14: java/lang/illegalstateexception Class 15: java/lang/illegalmonitorstateexception Class 16: java/lang/threaddeath Class 17: ExArithmetic Class 18: java/lang/system

Class 19: java/lang/stringindexoutofboundsexception Class 20: java/lang/runtimeexception Class 21: java/lang/exception Class 22: java/lang/runtime Class 23: java/io/printstream Class 24: lejos/nxt/lcdoutputstream Class 25: java/io/outputstream Class 26: java/io/ioexception Class 27: lejos/nxt/lcd Signature 0: main([ljava/lang/string;)v Signature 1: run()v Signature 2: <init>()v Signature 3: <clinit>()v Signature 4: notify()v Signature 5: notifyall()v Signature 6: wait()v Signature 7: wait(j)v Signature 8: start()v Signature 9: yield()v Signature 10: sleep(j)v Signature 11: currentthread()ljava/lang/thread; Signature 12: getpriority()i Signature 13: setpriority(i)v Signature 14: interrupt()v Signature 15: interrupted()z Signature 16: isinterrupted()z Signature 17: setdaemon(z)v

Signature 18: isdaemon()z Signature 19: join()v Signature 20: join(j)v Signature 21: currenttimemillis()j Signature 22: exit(i)v Signature 23: freememory()j Signature 24: totalmemory()j Signature 25: getmessage()ljava/lang/string; Signature 26: readsensorvalue(i)i Signature 27: setadtypebyid(ii)v Signature 28: setpowertypebyid(ii)v Signature 29: setpoller()v Signature 30: setthrottle(i)v Signature 31: test(ljava/lang/string;z)v Signature 32: testeq(ljava/lang/string;ii)v Signature 33: floattointbits(f)i Signature 34: intbitstofloat(i)f Signature 35: drawstring(ljava/lang/string;ii)v Signature 36: drawint(iii)v Signature 37: drawint(iiii)v Signature 38: refresh()v Signature 39: clear()v Signature 40: setdisplay([i)v Signature 41: getvoltagemillivolt()i Signature 42: readbuttons()i Signature 43: gettachocountbyid(i)i Signature 44: controlmotorbyid(iii)v

Signature 45: resettachocountbyid(i)v Signature 46: i2cenablebyid(i)v Signature 47: i2cbusybyid(i)i Signature 48: i2cstartbyid(iiii[bii)i Signature 49: i2cdisablebyid(i)v Signature 50: playtone(ii)v Signature 51: btsend([bi)v Signature 52: btreceive([b)v Signature 53: btgetbc4cmdmode()i Signature 54: btsetarmcmdmode(i)v Signature 55: btstartadconverter()v Signature 56: usbread([bi)i Signature 57: usbwrite([bi)v Signature 58: usbreset()v Signature 59: writepage([bi)v Signature 60: readpage([bi)v Signature 61: exec(ii)v Signature 62: playsample(iiii)v Signature 63: getdataaddress(ljava/lang/object;)i Signature 64: gc()v Signature 65: shutdown()v Signature 66: btsetresetlow()v Signature 67: btsetresethigh()v Signature 68: btwrite([bii)i Signature 69: btread([bii)i Signature 70: btpending()i Signature 71: arraycopy(ljava/lang/object;iljava/lang/object;ii)v

Signature 72: getdisplay()[i Signature 73: setautorefresh(i)v Signature 74: tostring()ljava/lang/string; Signature 75: <init>(ljava/lang/string;)v Signature 76: <init>([cii)v Signature 77: <init>([c)v Signature 78: length()i Signature 79: charat(i)c Signature 80: indexof(ii)i Signature 81: indexof(ljava/lang/string;i)i Signature 82: lastindexof(ljava/lang/string;i)i Signature 83: lastindexof([cii[ciii)i Signature 84: indexof([cii[ciii)i Signature 85: tochararray()[c Signature 86: substring(ii)ljava/lang/string; Signature 87: getruntime()ljava/lang/runtime; Signature 88: <init>(ljava/io/outputstream;)v Signature 89: write(i)v Signature 90: print(ljava/lang/string;)v Signature 91: flush()v Signature 92: write([bii)v Signature 93: bitblt([biiiiiiiii)v Signature 94: bitblt(iiiii)v Signature 95: drawchar(ciiz)v Signature 96: drawchar(ciii)v Signature 97: getdisplay()[b Signature 98: getsystemfont()[b

Signature 99: bitblt([biiii[biiiiiii)v Signature 100: scroll()v Master record : 16 bytes. Class records : 28 (280 bytes). Field records : 18 (18 bytes). Method records: 73 (876 bytes). Code : 62 (1196 bytes). Uploading...