wood burning stoves 2.0
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 OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "mock question doubt " Watch "mock question doubt " New topic

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 {
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?

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