Card 18 / 42: Which of the following is a correct instantiation for a BufferedWriter?
A)
BufferedWriter bw = new BufferedWriter(new File("data.txt"));
B)
BufferedWriter bw = new BufferedWriter(new FileWriter("data.txt"));
C)
BufferedWriter bw = new BufferedWriter(new PrintWriter("data.txt"));
D)
BufferedWriter bw = new BufferedWriter("data.txt");
Answer:
B) BufferedWriter bw = new BufferedWriter(new FileWriter("data.txt"));
C) BufferedWriter bw = new BufferedWriter(new PrintWriter("data.txt"));
Previous Card | ← Previous Card Button |
Next Card | → Next Card Button |
Flip Card | Space-Bar |