bt0074 unit 7 faqs

Upload: sreilal

Post on 06-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Bt0074 Unit 7 Faqs

    1/1

    Frequently Asked Questions

    1

    Subject Name: OOPS with Java Subject Code: BT0074

    Unit 7: Streams in JavaBalasubramani R

    Assistant ProfessorDept. of IT

    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 DataOutputStreamclasses.

    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.