Welcome Guest | Sign in | Register
Exceptions - Discussion Page For Q.2645 | Java Programming Questions and Answers | Java Programming Free Online-Tests | LucentBlackBoard | LucentBlackBoard.com

Home > Java Programming > Exceptions > Questions and Answers

Q: class A{
static void test() {
try {
String x = null;
System.out.print(x.toString() + " ");
}finally {
 System.out.print("finally "); 
}
}
public static void main(String[] args) {
try { test();
}
catch (Exception ex) {
 System.out.print("exception "); }
}
}

What is the result?
A. null B. finally
C. null finally D. Compilation fails.
E. finally exception

Answer and Explanation

Answer:finally exception

Explanation:
Just normal flow of execution.

Comment on this Question

Name:

Loading...




Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.