Java error handling mechanism, JAVA Programming

 

Errors: When a dynamic linking failure or some other "hard" failure in the virtual machine happens, the virtual machine gives an Error. Typical Java programs could not find Errors. In addition, it's unlikely that typical Java programs can ever give Errors either.

 

Exceptions: Most programs give and catch objects that define from the Exception class. Exceptions indicate that a problem happened but that the problem is not a serious JVM problem. An Exception class has different subclasses. These descendants indicate several types of exceptions that can happen. One exception subclass has unique meaning in the Java language: RuntimeException. All the exceptions except RuntimeException are checked on compile time. If a method is capable of gaining a checked exception it has to be declared it in its method header or handle it in a try/catch block.

 

1685_Untitled.png

 

A RuntimeException:class presents exceptions that happen within the Java virtual machine. A type of a runtime exception is NullPointerException. The price of checking for the runtime exception usually outweighs the benefit of catching it. Trying to catch or specify all of them all the time could prepare your code unmaintainable and unreadable. The compiler gives runtime exceptions to go unspecified and uncaught.

 

Posted Date: 7/25/2012 2:57:55 AM | Location : United States







Related Discussions:- Java error handling mechanism, Assignment Help, Ask Question on Java error handling mechanism, Get Answer, Expert's Help, Java error handling mechanism Discussions

Write discussion on Java error handling mechanism
Your posts are moderated
Related Questions
Write a Java ADB client to perform the following- The client will read the contents of the file - invoice.txt. The first line of the file will display the type of the currency. The

search a file with specific extension

program to find the frequency of a digit in a number

How can we define a computer screen? A computer screen is define as use to display output of computer to the user. Computer screen is consists of pixels.

what are Objects and Fields in java


It terminates execution of the block of statements in while or for loop & continues execution of the loop along with the next iteration. On the contrary to the break statement, con

What is a multicast delegate? Every delegate object holds reference to a single method. Though, it is possible for a delegate object to hold references of and invoke multiple m

#queThis assignment will give you practice with defining classes. You are to write a set of classes that define the behavior of certain animals. You will be given a program that r

What does the " abstract " keyword mean in front of a method and a class ?