Given a sample code:
1 import java.io.*;
2 class Test3 {
3 public static void main(String[] args) {
4 try {
5 File w = new File("user1.txt");
6 FileWriter fw = new FileWriter(w);
7 fw.write("helllo user");
8 fw.close();
9 } catch (IOException e) {
10 System.out.println(e);
}}
What will the result if it is compiled and run ?
(A) Makes a file
(B) Error caught at line no 6.
(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.