COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of these is a type of stream in Java?
A
Integer stream
B
Short stream
C
Byte stream
D
Long stream
Explanation: 

Detailed explanation-1: -The correct answer to the question “Which of these is a type of stream in Java” is, option (d). Byte stream. As you might be knowing, Java defines only 2 types of streams, they are Byte stream and the Character stream.

Detailed explanation-2: -There are two types of streams in Java: byte and character.

Detailed explanation-3: -In java, the byte stream is an 8 bits carrier. The byte stream in java allows us to transmit 8 bits of data. In Java 1.0 version all IO operations were byte oriented, there was no other stream (character stream). The java byte stream is defined by two abstract classes, InputStream and OutputStream.

Detailed explanation-4: -A bytestream is a sequence of bytes. Typically, each byte is an 8-bit quantity, and so the term octet stream is sometimes used interchangeably. An octet may be encoded as a sequence of 8 bits in multiple different ways (see bit numbering) so there is no unique and direct translation between bytestreams and bitstreams.

There is 1 question to complete.