Full width home advertisement

Post Page Advertisement [Top]

Exceptions are special types of error which occurred at run time and leads to abnormal termination of the program.
These exceptions are handled by the programmer.

Some types of exception are:
1. Math Error( such as division by zero)

2. Memory Error(such as memory full, index out of bound)

3. File system error(such as read/write error, file not found error)

4. Network Error( such as host not found, port already in use)

To handle this types of error java provides Exception class. These error handles as follow:

try
{
   //my code that may generate errors.
}
catch(Exception e)
{
   // code to be executed if error occurs.
}

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib