Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Catch(Exception e){
}

in that what is Exception and purpose of that in that place
exactly?

Answer Posted / anjani kumar jha

Before understand the concept of Catch u have to understand
the concept of try,that is why try?

Try-------it is used when we know that some piece of code is
going to throw some exception example when u are dividing
somthing/0 means it may throw exception so we use the try
block and put that code inside the try block

Catch:--------Every try there must be catch or finally
block. Catch is used to catch to exception.As for example
the division example may throw airthmatic exception so will
declare this exception in catch like

Catch(AirthmaticException ae)
{
System.out.println("hi cannt divide by zero");
System.out.println(ae);
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is parsing in java?

904


How would you format a date in java? I.e. In the ddmmyyy format?

1318


Explain notifyall() method of object class ?

1046


What is function declaration?

916


Explain about java sdk?

970


What is the finalize method do?

1049


Why char array is favored over string for the storage of passwords?

1000


What is Enum in Java?

1208


Write an algorithm for quick sort?

969


What will be the default values of all the elements of an array defined as an instance variable?

986


How do you define a variable?

895


Which package has light weight components in java programming?

1078


What happens when you add a double value to a string?

936


Is set sorted in java?

879


Can java program run without jre?

962