Search Header Logo

Java IO Streams

Authored by Ms STAFF

Computers

Professional Development

Used 2+ times

Java IO Streams
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class is used for reading bytes from a file in Java?

FileInputStream

BufferedReader

FileReader

DataInputStream

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between byte streams and character streams in Java?

Byte streams can only handle images; character streams are for audio files.

Byte streams are used for text data; character streams are for binary data.

Character streams are faster than byte streams for all types of data.

Byte streams are for binary data; character streams are for text data.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the role of BufferedInputStream in Java?

BufferedInputStream is a class for handling network connections.

BufferedInputStream improves I/O performance by buffering input data.

BufferedInputStream encrypts data for secure transmission.

BufferedInputStream is used for writing data to files.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to read a single character from a FileReader?

read()

getChar()

readChar()

fetch()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main difference between InputStream and Reader in Java?

InputStream reads bytes, while Reader reads characters.

InputStream reads characters, while Reader reads bytes.

InputStream is used for text files, while Reader is for binary files.

Both InputStream and Reader read bytes.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these methods is used to close an input or output stream in Java?

end()

finish()

stop()

close()

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the flush() method do in an output stream?

Clears any bytes from the input buffer

Forces any buffered output bytes to be written out

Closes the stream

Ends the output session

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?