File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Mock Exam Errata and the fly likes Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Doubt" Watch "Doubt" New topic


Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi, please look at the code
Which of the following are true statements?
1) I/O in Java can only be performed using the Listener classes
2) The RandomAccessFile class allows you to move directly to any point a file.
3) The creation of a named instance of the File class creates a matching file in the underlying operating system only when the close method is called.
4) The characteristics of an instance of the File class such as the directory separator, depend on the current underlying operating system
The below is explanantion for answer not being 3
The File class can be considered to represent information about a file rather than a real file object. You can create a file in the underlying operating system by passing an instance of a file to a stream such as FileOutputStream.
//The file will be created when you call the close method of the stream.
I cant understand the statement //...
Even if the close() method is not invoked also, the file
is created with data.
I agree. Here's the link:
subject: Doubt
It's not a secret anymore!