+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Java I/O Interview Questions and Answers


1
What is meant by Stream and what are the types of Streams and classes of the Streams?

A Stream is an abstraction that either produces or consumes information.
There are two types of Streams. They are:

  • Byte Streams : Byte Streams provide a convenient means for handling input and output of bytes.
  • Character Streams : Character Streams provide a convenient means for handling input and output of characters.
  • Byte Stream classes : Byte Streams are defined by using two abstract classes. They are:InputStream and OutputStream.
  • Character Stream classes :Character Streams are defined by using two abstract classes. They are : Reader and Writer.
2
What is the difference between the Reader/Writer class hierarchy and theInputStream/OutputStream class hierarchy?

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

3
What is the purpose of the File class?

The File class is used to create objects that provide access to the files and directories of a local file system.

4
What is an I/O filter?

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.

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

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

Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US