This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question  RSS feed

 
Mamta Swain
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I saw the following question in a mock exam.
Could anybody let me know the correct single choice of the following.
Q 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");
}

a. Prints out: Finally
b. Prints out: Exception
c. Prints out: Exception Finally
d. No output
My choice was d because from the above we cann't guess the output since the input parameter was not given.
The correct choice given was c.
Let me know if I am wrong.
- Mamta
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMHO this is a lousy Question but finally always prints anyway
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!