You are on page 1of 1

Frequently Asked Questions Subject Name: OOPS with Java Unit 7: Streams in Java

Balasubramani R Assistant Professor Dept. of IT

Subject Code: BT0074

Q1: What is a Stream? A1: Java handles all input and output in the form of streams. A stream is a sequence of bytes traveling from a source to a destination over a communication path. If a program writes into a stream, it is the streams source. Similarly, if it is reading from a stream, it is the streams destination. Q2: What are the two basic streams in Java? A2: The two basic streams used are the input and the output streams. Each stream has a particular functionality. You can only read from an input stream and conversely, you can only write to an output stream. Q3: What are Markable Streams? A3: Markable streams provide the capability of placing bookmarks on the stream and resetting it. This stream can then be read from the marked position. If a stream is marked, it must have some memory associated with it to keep track of the data between the mark and the current position of the stream. Q4: What are the various Stream Classes in Java? A4: Stream Classes are classified as FileInputStream, FileOutputStream, BufferedInputStream, BufferedOutputStream, DataInputStream, and DataOutputStream classes. Q5: What are Reader and Writer classes? A5: The Reader and Writer classes are abstract classes that support the reading and writing of Unicode character streams. Unicode is used to represent data such that each character is represented by 16 bits.

You might also like