© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu

Home Placements Interview Questions Java Interview Questions And Answers Java Interview Questions On Input and Output Stream ▼

Java Interview Questions On Input and Output Stream

1. What value does readLine() return when it has reached the end of a file?

Answer
The readLine() method returns null when it has reached the end of a file.

2. What value does read() return when it has reached the end of a file?

Answer
The read() method returns -1 when it has reached the end of a file.

3. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

Answer
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.

4. What is synchronization and why is it important?

Answer
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

5. What class allows you to read objects directly from a stream?

Answer
The ObjectInputStream class supports the reading of objects from input streams

6. What an I/O filter?

Answer
An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.

Next
1 2
SLogix Student Projects
bottom