Home Tutorial Java Scjp Part10 SCJP Module-10 Question-1

 
 

Share on Google+Share on Google+
SCJP Module-10 Question-1
Posted on: July 16, 2010 at 12:00 AM
Advertisement
The given program will test your understanding of File class and its package in Java.

Given a sample code:

1    // place code here

2    public class Test {
3    public static void main(String[] args) throws Exception {
4    File file = new File("test.txt");
5    System.out.println(file.exists());
}}

What code should be placed at line no 1 for the successfully execution of above code?
Choose correct options?

(A) import java.io.*;
(B) import java.io.File; 
(C) import.java.util.*;
(D) import java.lang;

Answer:

(A) or (B)

Advertisement

Related Tags for SCJP Module-10 Question-1:


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.

Posted on: July 16, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com