File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes I.O read and write same time????? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "I.O read and write same time?????" Watch "I.O read and write same time?????" New topic
Author

I.O read and write same time?????

Michael Lin
Ranch Hand

Joined: Dec 04, 2000
Posts: 31
//this is the mock from : http://www.geocities.com/SiliconValley/Orchard/9362/java/javacert/newboone40-70.html
//I think the answer is c: a file can only be opened for either reading or writing, not both, but the answer is a.
//and I also think only the RandomAccessFile can be done both same time,
//am I right?? thanks!
Question 38: What does the following code do?
File f = new File("hello.test");
FileOutputStream out = new FileOutputStream(f);
Select the one right answer.
Create a new file named "hello.test" if it does not yet exist. It also opens the file so
you can write to it and read from it.
a.Create a new file named "hello.test" if it does not yet exist. The file is not opened.
b.Open a file named "hello.test" so that you can write to it and read from it, but
does not create the file if it does not yet exist.
c.Open a file named "hello.test" so that you can write to it but cannot read from it.
d.Create an object that you can now use to create and open the file named
"hello.test," and write to and read from the file.
Baswa Shaker
Greenhorn

Joined: Oct 18, 2000
Posts: 17
c
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I.O read and write same time?????
 
Similar Threads
Files
i/o streams
Boones' Exam Question Doubt
Files
Some confusing ones part2