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 a parameter in java?
How would you use Bubble Sort to sort the number of elements?
What happens when you invoke a thread’s interrupt method while it is sleeping or waiting?
What are the 7 types of characters?
What is the use of conditional statement?
Which collection is sorted in java?
How to set the permissions to a file in java?
Is java hashset ordered?
Is overriding possible in java?
What do you mean by an object in java?
What methods are used to get and set the text label displayed by a button object?
What is the return type of the main method?
Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?
What is the purpose of file class?
How do I remove a character from a string in java?