aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes need guidance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "need guidance" Watch "need guidance" New topic
Author

need guidance

Rajesh k Jha
Ranch Hand

Joined: May 10, 2009
Posts: 72


The result of this programme is compilation fail..What i guess is if we are sure that in the try block if it is 100% surity that exception will be thrown as we can see in the line 1, then there should not be any line below that? Please guide me if i wrongly understood the concept?
Samrat Som
Ranch Hand

Joined: Feb 04, 2009
Posts: 40
yep rakesh you are correct . As the Code is unreachable. You will get an Compilation error saying Unreachable Code.


SCJP 1.6
SCWCD 1.5 (Preparing...)
Nitish Bangera
Ranch Hand

Joined: Jul 15, 2009
Posts: 537

the surity is given by the throw keyword. If it were a risky statement then probably this won't be a correct answer. Also other part is if you are catching a checked exception means your try block should have a statement which threatens to throw a checked exception. If not then there will be compiler error again.


[ SCJP 6.0 - 90% ] , JSP, Servlets and Learning EJB.
Try out the programs using a TextEditor. Textpad - Java 6 api
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14266
    
  21

The following page explains how to use code tags: http://faq.javaranch.com/java/UseCodeTags

In particular: write "code" with a small c, don't write [Code]. Note that above the editing window, there is a button named "Code" that you can click to start or end a code block.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need guidance