File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 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: 2398
The output will always include the word Finally.
Don't get me started about those stupid light bulbs.
subject: mock question doubt
It's not a secret anymore!