Given a sample code:
import java.io.File;
public class Test {
public static void main(String[] args) throws Exception {
File file = new File("test.txt");
System.out.println(file.exists());
}}
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.
(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.