Write Statements Following Opens File Named Mynametxt Writes First Nama File Closes File S Q37032377

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.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();

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.