Friday 18 January 2013

Class X - Exception Handling

When we write a program sometimes we cannot be very sure whether it is clean that is error free.The unexpected situation which arises due to the improper use of the code is called as Exception.Overcoming such situation is called Exception Handling.
try and catch are the keywords used in exception handling. Any exception(error) occuring within the try block is trapped. A comment is passed to the exception handler about the error which is done by catch block.

Wrapper Class:

We know that the data accepted through the keyboard will be a string and it should be converted to various premitive data type to do any arithmetical operations.This is done by wrapper class.

e.g:

Integer.parseInt

Package :

A Package is a group of classes which can be imported to a program.

No comments:

Post a Comment