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 a class object?

0 Answers  


why java does not support unsigned keyword?

1 Answers  


What is difference between final and immutable?

0 Answers  


Is java a digit method?

0 Answers  


how to deploy tomcatserver to weblogic server? write d following steps?

0 Answers  


Why does java not support pointers?

0 Answers  


Explain when classnotfoundexception will be raised ?

0 Answers  


What do you mean by an object in java?

0 Answers  


What is intern method in java?

0 Answers  


why abstract class does not have object creation

6 Answers   Value Labs,


What is java instanceof operator?

0 Answers  


What are the advantages of java over C++?

0 Answers  


Categories