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

Why multiple inheritance is not supported by java?

965


What is the association?

961


Can you inherit a constructor java?

1056


Can we sort a map in java?

1020


What is the type of lambda expression?

1007


How is garbage collection controlled?

1159


Variables used in a switch statement can be used with which datatypes?

982


What is array list in java?

1061


How are variables stored?

961


What is ordered map in java?

980


What is method in java with example?

929


Difference between ‘>>’ and ‘>>>’ operators in java?

1111


Why should I use abstract class?

1079


What are the advantages and disadvantages of reference counting in garbage collection?

1003


Why use string handling in Java?

1017