aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Applied Reasoning #51 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Applied Reasoning #51" Watch "Applied Reasoning #51" New topic
Author

Applied Reasoning #51

Gerry Timmermans
Greenhorn

Joined: Dec 15, 2000
Posts: 10
Taken from appliedreasoning.com mock quest #51
Which of the following statements about java.io.RandomAccessFile are true?
A. An instance of RandomAccessFile must be created with a mode.
B. When an instance of RandomAccessFile is created with a read mode, the underlying file will be created if it does not already exist.
C. When an instance of RandomAccessFile is created with a read/write mode, the underlying file will be created if it does not already exist.
D. The RandomAccessFile implements the java.io.DataOutput and java.io.DataInput interfaces.
E. If a RandomAccessFile is opened for read on a file that does not exist the FileNotFoundException is thrown.

First off, this is a hard mock exam! The answer given for the above question is A, C, D, E. I had only A & E. I missed C because I was sure I'd read somewhere that a RandomAccessFile will throw an exception if the file it refers to does not exist regardless of whether or not it is created "rw" or "r". I'm probably wrong but can someone confirm that these answers make sense. I'm going to try it out myself but I thought I'd throw it out to all you folk to ponder as well.
Thanks ... Gerry
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4089
i believe the test is correct. try checking the API it should tell you.


SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applied Reasoning #51
 
Similar Threads
RandomAccessFile Class
NX: RandomAccessFile - "rw", "rwd"
file instance
A questin in Marcus's tutorial
B&S => db error handling