Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock: java.io.File

 
adam Lui
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which can be constructed using an instance of java.io.File?
A. java.io.FileWriter
B. java.io.BufferedWriter
c. java.io.PrintWriter
D. java.io.FileReader
E. java.io.BufferedReader

i think the answers are A and D. correct?
 
Jari Timonen
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read the answers from API: http://java.sun.com/j2se/1.5.0/docs/api/

The reason why i'm not giving straight answer is that YOU NEED TO KNOW HOW TO READ API.

[ November 12, 2007: Message edited by: Jari Timonen ]
[ November 12, 2007: Message edited by: Jari Timonen ]
 
Fu Dong Jia
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!adam Lui.
the answer C are correct too!
because from java5 ,the File class can also constructe PrintWriter.
 
Fu Dong Jia
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Constructor Summary
PrintWriter(File file)
Creates a new PrintWriter, without automatic line flushing, with the specified file.
PrintWriter(File file, String csn)
Creates a new PrintWriter, without automatic line flushing, with the specified file and charset.
PrintWriter(OutputStream out)
Create a new PrintWriter, without automatic line flushing, from an existing OutputStream.
PrintWriter(OutputStream out, boolean autoFlush)
Create a new PrintWriter from an existing OutputStream.
PrintWriter(String fileName)
Creates a new PrintWriter, without automatic line flushing, with the specified file name.
PrintWriter(String fileName, String csn)
Creates a new PrintWriter, without automatic line flushing, with the specified file name and charset.
PrintWriter(Writer out)
Create a new PrintWriter, without automatic line flushing.
PrintWriter(Writer out, boolean autoFlush)
Create a new PrintWriter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic