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

Which is fastest collection in java?

1091


Explain the difference between abstract class and interface in java?

995


How do you sort a string in java?

971


What are the important features of Java 9 release?

1007


Can we access instance variables within static methods ?

1105


why are there separate wait and sleep methods? : Java thread

1033


Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?

1168


Is set sorted in java?

937


What is the difference between the ">>" and " >>>" operators in java?

988


Difference between static and dynamic class loading.

1132


What is java autoboxing?

957


What is the purpose of assert keyword used in jdk1.4.x?

1068


v-model life cycle

2051


What is the null?

1025


what is the difference between the methods sleep() and wait()? : Java thread

983