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 will happen if we write code like:
try{}catch(exception e)catch(IOException i)

Answers were Sorted based on User's Feedback



What will happen if we write code like: try{}catch(exception e)catch(IOException i)..

Answer / guest

It will not compile.

Is This Answer Correct ?    26 Yes 8 No

What will happen if we write code like: try{}catch(exception e)catch(IOException i)..

Answer / sitaram

it is not complied. because first catch having child
exception and last exception having parent exception is must.
correct answer is :
try{
}
catch(IOException i){
}
catch(Exception e){
}

Is This Answer Correct ?    19 Yes 2 No

What will happen if we write code like: try{}catch(exception e)catch(IOException i)..

Answer / maurice johnson

Ignoring the incorrect syntax of the Try\Catch Block, it
will never reach the IOException portion of the
Catch......the first catch will always be triggered due to
it only Catching type Exception.

Is This Answer Correct ?    12 Yes 3 No

What will happen if we write code like: try{}catch(exception e)catch(IOException i)..

Answer / jahri

yes it should be child exception to base exception

Is This Answer Correct ?    4 Yes 1 No

What will happen if we write code like: try{}catch(exception e)catch(IOException i)..

Answer / mathi

Ignoring the incorrect syntax of the Try\Catch Block, it
will never reach the IOException portion of the
Catch......the first catch will always be triggered due to
it only Catching type Exception.

Is This Answer Correct ?    1 Yes 1 No

What will happen if we write code like: try{}catch(exception e)catch(IOException i)..

Answer / sonal

I knew the answer but tried it to get the exact compile
time error. It reads "exception java.io.IOException is
already been caught".

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is mean by collections in java?

0 Answers  


Is 0 a real number?

0 Answers  


What are pass by reference and pass by value?

0 Answers  


What are the notations in Java?

1 Answers   Cap Gemini,


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

0 Answers  


What is string in java?

0 Answers  


How do you declare an infinite loop?

2 Answers  


Why do we need to override equals() and hascode() method of object class?

1 Answers   Cognizant,


What is the use of arraylist class in java?

0 Answers  


What happens when I use / and % with a negative numerator?

0 Answers  


What is the root class for all Java classes?

8 Answers   IBM, Infosys,


Explain the Propertie sof class?

0 Answers  


Categories