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

 
 

SCJP Module-10 Question-1
Posted on: July 16, 2010 at 12:00 AM
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)

Related Tags for SCJP Module-10 Question-1:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.