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

Home > Java Programming > Exceptions > Questions and Answers

Q: class A{
public static void main(String args[]){
try{
System.out.println(“one”); 
}catch(Exception e){
System.out.println(“two”); }
finally{
System.out.println(“three”); }
}
}
A. one , two , three B. one
C. one , three D. compile time error

Answer and Explanation

Answer:one , three

Explanation:
In the above example only try and finally will execute, as there is no exception catch block will not execute.
So c) is correct.

Comment on this Question

Name:

Loading...




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