Java IO Streams Interview Questions and Answers

Java IO Streams Interview Questions


1) What is Stream?

A) A stream is a logical connection between a java program and a File.
                             (or)
A stream can be defined as a continuous flow of data between the java program and persistence media.

2) How many types of Streams are there?

A) There are two types of Streams they are:
1) Input Stream.       
2) Output Stream.

3) What is the Input Stream?

A) The Stream that allows data to come into Java application from the persistent media is called an Input Stream. Input Stream is used to read the data from persistent media.

4) What is Output Stream?

A) The Stream that allows data to send out from the Java application to be stored into the persistent media is called Output Stream. Output streams are used to write data in persistent media from a Java application.

5) How data is sent to Streams in Java?

A) In Java data is send to Streams in the format of Bytes or Characters.

6) How many types of Java Streams are there in Java?

A) There are two types of Java Streams are there in Java. They are:
1) Binary Stream.
2) Character Stream.

7) What is Binary Stream?

A) The Stream which read and write data in the format of bytes is called Binary Streams.

8) What is Character Stream?

A) The Streams which read and write data in the format of characters is called Character Streams.

9) What is Sequence Input Stream?

A) This class is used to read data from multiple Input Streams Sequentially.

10) What is File InputStream?

A) File InputStream is a subclass of InputStream and Closeable, Autocloseable interfaces. File InputStream class is used to read data from a File.

11) What is File OutputStream?

A) File OutputStream is a subclass of OutputStream and Closeable, Flushable, AutoCloseable interfaces. File OutputStream is used to write data to a File.

12) What are the limitations of File InputStream and File OutputStream?

A) File InputStream and File OutputStream allow User to read and write data Only in the format of bytes. It is not possible to read (or) write data in the format of primitive data or objects.

13) What is Data InputStream?

A) Data InputStream is used to read data as primitive types.

14) What is Data OutputStream?

A) Data OutputStream is used to write data as primitive types.

15) What are the limitations of Data InputStream and Data OutputStream?

A) Using Data InputStream and Data OutputStream user cannot read and write objects from persistent media. They have the capability only to read data up to primitive data types.

16) What is Object InputStream?

A) Object InputStream is used to read data as an Object.

17) What is Object OutputStream?

A) Object OutputStream is used to write data as Object.

18) What is Serialization?

A) Serialization is the process of converting objects into a stream of bytes and sending them to OutputStream. Using Serialization we can store object state permanently in the destination.

19) What is Deserialization?

A) Deserialization is the process of converting a stream of bytes into the original location.

20) What is Marker Interface?

A) The Interface using which user can explicitly mention (or) Mark certain properties to an Object is known as Marker Interface.

21) Explain about Transient Keyword?
Share:

Search This Blog

  • ()

Our Services

Powered by Blogger.

FSU Webmail and login into the FSU Webmail

FSU Webmail FSU Webmail (Florida State University) Webmail is email administrations to the customer to get to messages anyplace through a...