import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Tester { public static void main(String[] args) { try { File file = new File("data.txt");// line 5 file.createNewFile(); // line 6 FileWriter fr = new FileWriter(file); // line 7 BufferedWriter br = new BufferedWriter(fr); // line 8 br.append("javachamp"); br.flush(); br.close(); // line 11 } catch (IOException e) { e.printStackTrace(); } } }
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
public class Tester {
public static void main(String[] args) {
try {
File file = new File("data.txt");// line 5
file.createNewFile(); // line 6
FileWriter fr = new FileWriter(file); // line 7
BufferedWriter br = new BufferedWriter(fr); // line 8
br.append("javachamp");
br.flush();
br.close(); // line 11
} catch (IOException e) {
e.printStackTrace();
}
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.