answersLogoWhite

0


Best Answer

Exceptions are thrown when Java encounters an error. They are a fundamental part of the Java error handling system. In a nutshell, Java will throw an Exception when it encounters an error so that an exception handler can "handle" the error. For instance, if a calculator program is given the command "1/0", Java can throw an ArithmeticException which could be reported back to the user.

Some common types are:

  • ArithmeticException - thrown when arithmetic error has occurred, like dividing by 0
  • IOException - thrown when an input or output error has occurred, like a file not found
  • ArrayIndexOutOfBoundsException - thrown when a nonexistent element of an array is requested, like arr[-1]
  • NullPointerException - thrown when some operation if performed on an object whose value is nll.
User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is exception and list some of the common type of exception?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does throws throws only unchecked exception?

You can throw any type of exception you want, including an unchecked exception.


What type of eukaryotes are protists with the exception of algae?

Protists, with the exception of algae, are unicellular.


faq for patients?

FAQ for patients are the frequently asked questions for some type of doctor's office or hospital. The FAQ will list the most common questions patients may ask.


What With the exception of algae all protists are what type of eukaryotes?

Protists, with the exception of algae, are unicellular.


How common is dialysis?

It is very common in patients who have had some type of heart surgery.


Will a type II PC card slot read a type I card?

Yes most card readers will read both formats, with the exception of some early models


With the exception of algae all protist are what type of eukaryote?

Protists, with the exception of algae, are unicellular.


Are all gun retailers required to do a background check before selling a gun to the purchaser of a gun?

Yes, with the exception of some people that have a type of gun license where they have already had a background check.Yes. With the exception of people that have already had a background check, all dealers are required by Federal law to conduct a background check.


What is a list of foods for B blood type?

There are list of foods that are better for your diet depending what blood type you are. Some of the foods that are recommended are dairy, beans fruits and vegatables. There are even some foods that help out with weight loss.


What is class cast exception?

The class case exception is thrown when an object A of class type B is cast to a class type C where C is neither B nor its subclass.


What is the quality that most robots have in common?

Some type of movement.


How common is lissencephaly?

Type I lissencephaly is more common and comprises 43% of lissencephaly syndromes in some studies. Type II lissencephaly accounted for 14% of lissencephalies