Ques 236. What is the difference between the File and RandomAccessFile classes?
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.
Is it helpful?
Add CommentView Comments
Ques 237. What interface must an object implement before it can be written to a stream as an object?
An object must implement the Serializable or Externalizable interface before it can be written to a stream as an object.
Is it helpful?
Add CommentView Comments
Ques 238. What value does readLine() return when it has reached the end of a file?
The readLine() method returns null when it has reached the end of a file.
Is it helpful?
Add CommentView Comments
Ques 239. What value does read() return when it has reached the end of a file?
The read() method returns -1 when it has reached the end of a file.
Is it helpful?
Add CommentView Comments
Ques 240. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.