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...


what is unreachable code problem in multiple catch statements

Answers were Sorted based on User's Feedback



what is unreachable code problem in multiple catch statements..

Answer / deepthi

if v just gve a default exception block,bfre the specific
catch statement it ll create a unreachable code exception
e.g
catch(Exception e)
{System.out.println(unknown exception);}
catch(ArithmeticException e)
{System.out.println("Division by zero");}

Is This Answer Correct ?    6 Yes 0 No

what is unreachable code problem in multiple catch statements..

Answer / sriragv

Subclass exception handler should come first then the
superclass has to come next. Then only code wil compile
otherwise subclass exception will be never reached results
compilation error.

Is This Answer Correct ?    5 Yes 0 No

what is unreachable code problem in multiple catch statements..

Answer / bijoy baby

super class can handle sub class Exception. That's why when
super class handler placed before sub class handler then the
exception object will not thrown to sub class handler.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

How to check if a list is sorted in java?

0 Answers  


What are different types of multitasking?

0 Answers  


Can we clone singleton object?

0 Answers  


What an i/o filter?

0 Answers  


Can we override tostring method in java?

0 Answers  


What is a method signature java?

0 Answers  


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

0 Answers   Fidelity,


How do you do absolute value in java?

0 Answers  


Distinguish method overloading and overriding

2 Answers   Tech Mahindra,


What collections you have worked on? Internal working of Hashmap?

1 Answers   Bravura Solutions,


Why volatile is used in java?

0 Answers  


According to java operator precedence, which operator is considered to be with highest precedence?

0 Answers  


Categories