Answer Posted / gagan jain
common exceptions:
Java has several predefines exceptions. the most common
exceptions that you may encounter are described below.
Arithmetic Exception:-
This exception is thrown when an exceptional arithmetic
condition has occurred. for example, a division by zero
generates such an exception.
Nullpointer Exception:-
This exception is thrown when an application attempts to
use null where an object is required. An object that has
not been allocated memory holds a null value. the
situations in which an exception is thrown include:
1. Using an object without allocating memory for it.
2. Calling the methods of a null object.
3. Accessing or modifying the attributes of null obect.
ArrayIndexoutof Bounds Exception
The exception Arrayindexoutofbounds Exceptions is thrown
when an attempt is made to access an array element beyond
the index of the array. for example, if you try to access
the eleventh element of an array that's has only ten
elements, the exception will be thrown.
| Is This Answer Correct ? | 16 Yes | 9 No |
Post New Answer View All Answers
Which is better singleton or static class?
Name few java.lang classes introduced with java 8 ?
Define an abstract class with reference to java.
Explain Basics of OOP Language in java
What is string substring?
How many bytes is string in java?
When is an object subject to garbage collection?
Is there any tag in htm to upload and download files?
What is the difference between public, private, protected, and friend access?
What is a modifier?
Which list is sorted in java?
What about interthread communication and how it takes place in java?
What is the meaning of variables in research?
Are functions objects in java?
What is the new line character?