wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Stream Java

Total questions: 27

Worksheet time: 27mins

Name
Class
Date
1.

superclass of all classes representing the output stream of characters is -------------

a)

OutputStream

b)

Reader

c)

InputStream

d)

Writer

2.

which of this class is used by character streams for reading data from buffer

a)

BufferReader

b)

InputStreamReader

c)

FileReader

d)

FileInputStream

3.
Which of these method of FileReader class is used to read characters from a file?
a)
read()
b)
scanf()
c)
get()
d)
getInteger()
4.
Which of these packages contain classes and interfaces used for input & output operations of a program?
a)
java.util
b)
java.lang
c)
java.io
d)
all of the mentioned
5.
Which of these class is not related to input and output stream in terms of functioning?
a)
File
b)
Write
c)
InputStream
d)
Reader
6.
Which stream used to read data from a source, it may be a file, an array, peripheral device or socket?
a)
InputStream
b)
OutputStream
c)
Input/OutputStream
d)
None of the above
7.
Which is used for writing data to a file in file handling?
a)
FileInputStream
b)
FileOutputStream
c)
Both A & B
d)
None of the above
8.
Which method is used to close the Stream?
a)
close();
b)
flush();
c)
null();
d)
final();
9.
 Which exception is thrown by read() method?
a)
SystemInputException
b)
IOException
c)
SystemException
d)
InterruptedException
10.

Which of these class is used to read characters and strings in Java from console?

a)

StringReader

b)

BufferedReader

c)

InputStreamReader

d)

BufferedStreamReader

11.

Which of these is a type of stream in Java?

a)

Integer stream

b)

Byte Stream

c)

Short Stream

d)

Long Stream

12.

Which of these classes are used by character streams for input and output operations?

a)

InputStream

b)

InputOutputStream

c)

ReadStream

d)

Writer

13.

Which exception is thrown by read() method?

a)

IOException

b)

InterruptedException

c)

SystemException

d)

SystemInputException

14.

I socket inviano e ricevono dati in sequenze di ... (due risposte)

a)

bytes

b)

caratteri

c)

interi

d)

numeri reali

15.

Uno stream in Java è ... (due risposte)

a)

un canale di comunicazione bidirezionale

b)

un canale di comunicazione monodirezionale

c)

un canale di comunicazione su file esterno

d)

associato ad un Socket

16.

Classi astratte che implementano gli Stream di input sono ... (due risposte)

a)

Reader

b)

InputStream

c)

Writer

d)

OutputStream

17.

Classi astratte che implementano gli Stream di output sono ... (due risposte)

a)

Reader

b)

InputStream

c)

Writer

d)

OutputStream

18.

L'informazione sullo Stream viene letta/scritta con modalità

a)

FIFO

b)

LIFO

c)

Lista

d)

Array

19.

Rader/Writer superclassi per ...

a)

realizzare stream che leggono caratteri

b)

realizzare stream che leggono byte

c)

realizzare stream che leggono interi

d)

realizzare stream che leggono valori booleani

20.

InputStreamReader (due risposte)

a)

Sottoclasse di Reader

b)

crea un ponte stream a byte e a carattere

c)

crea un oggetto OutputStreamReader

d)

crea un ponte stream che associa byte a caratteri

21.

InputStream/OutputStream superclassi per ...

a)

realizzare stream che leggono caratteri

b)

realizzare stream che leggono byte

c)

realizzare stream che leggono interi

d)

realizzare stream che leggono valori booleani

22.

DataInputStream

a)

fornisce metodi per leggere dati in formato complesso da InputStream

b)

fornisce metodi per scrivere dati in formato complesso su OutputStream

c)

Tratta dati di tipo byte, int, String

d)

Tratta dati di tipo array

23.

DataOutputStream

a)

fornisce metodi per leggere dati in formato complesso da InputStream

b)

fornisce metodi per scrivere dati in formato complesso su OutputStream

c)

Tratta dati di tipo byte, int, String

d)

Tratta dati di tipo array

24.

byte readByte() (due risposte)

a)

metodo della classe DataInputStream

b)

legge un byte

c)

legge diversi byte

d)

legge un int

25.

byte readInt() (due risposte)

a)

metodo della classe DataInputStream

b)

legge un byte

c)

legge diversi byte

d)

legge un int

26.

String readLine()

a)

legge la prossima linea di testo da input stream e restituisce una stringa. Legge una successione di byte, trasformandoli in caratteri, fino al terminatore di linea

b)

legge una stringa che è stata rappresentata da una stringa di caratteri Unicode codificata usando il formato UTF-8

c)

legge la prossima linea di testo da output stream

d)

legge due bytes in input

27.

String readUTF()

a)

legge la prossima linea di testo da input stream e restituisce una stringa. Legge una successione di byte, trasformandoli in caratteri, fino al terminatore di linea

b)

legge una stringa che è stata rappresentata da una stringa di caratteri Unicode codificata usando il formato UTF-8

c)

legge la prossima linea di testo da output stream

d)

legge due bytes in input