this is java
Write statements that do the following: opens a file named MyName.txt, writes your first nama file, and then closes the file. (Suppose i import java.io.*; is already in your program.) Show transcribed image text Write statements that do the following: opens a file named MyName.txt, writes your first nama file, and then closes the file. (Suppose i import java.io.*; is already in your program.)
Solution
Answer:-
BufferedWriter fl= new BufferedWriter( newFileWriter(fileName));
fl.write(“Somename”);
fl.close();