Saturday, September 5, 2009

SCJP Questions

Given:
1 public class foo {
2 public static void main (string[]args)
3 try {return;}
4 finally {system.out.printIn("Finally");}
5 }
6 )
What is the result?
A. The program runs and prints nothing.
B. The program runs and prints "Finally"
C. The code compiles, but an exception is thrown at runtime.
D. The code will not compile because the catch block is missing.
Answer: B

0 comments:

Post a Comment

 

About

Site Info

Information Source

Academy of JAVA by Rajesh Rolen Copyright © 2009 Community is Developed by Rajesh Kumar Rolen WebSite

/* tracking code by yahoo login */