Given a sample code:
1 public class Test {
2 public static void main(String argv[]) {
3 Test m = new Test();
4 m.findFile();
}
5 public void findFile() {
6 try {
7 new FileInputStream("Hello.txt");
8 } catch (FileNotFoundException e) {
9 System.out.println("file not found");
}}}
What operation does this code perform?
(A) Creates a file Hello.txt
(B) It will display output "file not found"
(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.