This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes mock question doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "mock question doubt " Watch "mock question doubt " New topic
Author

mock question doubt

raja kanak
Ranch Hand

Joined: Oct 18, 2006
Posts: 135
13) public void divide(int a, int b) {
try {
int c = a / b;
}
catch (Exception e) {
System.out.print("Exception ");
} finally {
System.out.println("Finally");
}
1) Prints out: Finally
2) Prints out: Exception
3) Prints out: Exception Finally
4) No output
4tests.com says the answer is 3.
But i think it is 4 (assuming a=1; b=1)

Am i right?


live
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
The output will always include the word Finally.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mock question doubt