Card 9 / 42: Which of the following statements is a correct instantiation of PrintWriter?
A)
PrintWriter writer = new PrintWriter("file.dat");
B)
PrintWriter writer = new PrintWriter(new BufferedWriter("file.dat"));
C)
PrintWriter writer = new PrintWriter(new FileWriter("file.dat"));
D)
PrintWriter writer = new PrintWriter(new File("file.dat"));
Answer:
A) PrintWriter writer = new PrintWriter("file.dat");
C) PrintWriter writer = new PrintWriter(new FileWriter("file.dat"));
D) PrintWriter writer = new PrintWriter(new File("file.dat"));
Previous Card | ← Previous Card Button |
Next Card | → Next Card Button |
Flip Card | Space-Bar |
|
Oracle Certified Professional Java Programmer
Author:
JavaChamp TeamSenior Java Developer
QuizOver.com
Germany
Access: |