Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Core Java Interview Questions and Answers

Test your skills through the online practice test: Core Java Quiz Online Practice Test

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 Comment View 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 Comment View 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 Comment View 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 Comment View 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.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook