Share on Google+Share on Google+

SCJP Module-10 Question-2

The sample example given below will test your understanding of File class of Java.

Given a sample code:


public class Test {
public static void main(String[] args) throws Exception {
File file = new File("test.txt");

What will the result if it is compiled and run at first time?

(A) true
(B) false 
(C) Compile time error.
(D) Raise run-time exception.




Posted on: July 16, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.