my dog learned polymorphism*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Java IO package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Java IO package" Watch "Java IO package" New topic
Author

Java IO package

Dinesh Tahiliani
Ranch Hand

Joined: Aug 06, 2007
Posts: 486
Which can be constructed using java.io.File?

1. java.io.FileWriter
2.java.io.FileReader
3.java.io.PrintWriter
4.java.io.BufferedWriter
5.java.io.BufferedReader.

I think it should be 1,2,4,5

Can anyone suggest??


Thanks<br />Dinesh
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8875
    
    5
Hey Dinesh,

Part of the intention of the exam is to teach candidates how to use the API documentation. This question should be very easy for you to research...if you've practiced using the API. If you haven't started using the API yet then you might as well start now because you're going to need to learn how sooner or later! Every Java programmer needs to know how to use the API docs!

hth,

Bert


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Krishnamoorthy Vuyala Muralidharan
Ranch Hand

Joined: Sep 13, 2005
Posts: 52
Hi Dinesh

What Bert has told is perfectly correct, sooner or later you must start reading the APIs.

If I understood your question correct, then the answers from the below choices:


1.FileReader
2.FileWriter
3.PrintWriter
4.BufferedReader
5.BufferedWriter

would be as follows:

1, 2, 3


Some of the Constructors of these classes which takes File as an argument:
FileWriter(File file)

FileReader(File file)

PrintWriter(File file)

BufferedReader(Reader in)

BufferedWriter(Writer out)

HTH
Kris
karthik damodaran
Greenhorn

Joined: Jun 24, 2008
Posts: 3
Hey Dinesh

It s clearly given in API. Just check it out....


Karthikeyan.D
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

What is the source of this question ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java IO package