Exam Permalink:
https://www.jobilize.com/java-certification-questions
Question Permalink:
https://www.jobilize.com/how-to-create-file-in-java
Question 86 / 297:  At what line in the following program the file "data.txt" will be created in the file system?
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();

}

}

}

A  Line 5
B  Line 6
C  Line 7
D  Line 8
E  Line 11
<< First < Previous Next > Last >>
Exam Home Page
https://www.jobilize.com/java-certification-questions

Oracle Certified Professional Java Programmer

Author:

Access: Public Instant Grading

Ask
Lakeima Roberts
Start Quiz
Stephanie Redfern
Start Quiz
Yacoub Jayoghli
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>