Given a sample code:
import java.io.*;
class Test3 {
public static void main(String[] args) {
try {
File w = new File("test.txt");
FileWriter fw = new FileWriter(w);
fw.write("test message");
fw.close();
} catch (IOException e) {
System.out.println(e);
}}}
Is the above code can make a file and can write ? Choose correct option?
(A) Yes
(B) No
(A)
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.