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?

Answers were Sorted based on User's Feedback



Catch(Exception e){ } in that what is Exception and purpose of that in that place exactly?..

Answer / 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

Catch(Exception e){ } in that what is Exception and purpose of that in that place exactly?..

Answer / sreenu karampudi

The Catch block is used to catch the exception which is
from the try block. The exception type should be same in
order to catch it otherwise it won't

for example;

try {
// piece of code which gets ArthimeticException
}

Catch(ArthimeticException e) [
}

Is This Answer Correct ?    2 Yes 1 No

Catch(Exception e){ } in that what is Exception and purpose of that in that place exactly?..

Answer / kabita

bcoz Exception is d base class of all exceptions arise in d
programme.if u write this no need to consider what type of
exception is arised in try block of d programme.,it will
handle all d exception.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

How the elements are organized in CardLayout?

5 Answers  


Which class contains a method: cloneable or object?

0 Answers  


Tell me a few examples of final classes defined in Java API?

0 Answers   DELL,


How many objects are created for a singleton class

7 Answers   Ness Technologies,


Adapter classes?

3 Answers  


What is aggregation and composition ?

1 Answers   Fidelity,


Why const and goto are reserved keyword in java?

1 Answers  


Can you make a constructor final in Java?

0 Answers   SwanSoft Technologies,


Explain jvm, jre, and jdk?

0 Answers  


Is java util list serializable?

0 Answers  


What are the kinds of polymorphism?

0 Answers  


Difference between Encapsulation and Abstraction

4 Answers   Fidelity,


Categories