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
What is off heap memory?
What is java abstraction with example?
What is a list in java?
What is an infinite loop? How infinite loop is declared?
Can we make a constructor final?
Is namespace same as package in java?
what is a thread pool in java and why is it used?
What is the finalize method do?
What is a variable analysis?
What are the disadvantages of using inner classes?
What is finally in Java?
Is space a char?
What are serialization and deserialization?
Difference between current previous versions of Java?
What are the basics of core java?