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;
(A) or (B)
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.