Adv Java Quiz 1

Adv Java Quiz 1

University

10 Qs

quiz-placeholder

Similar activities

Java Programming

Java Programming

University

10 Qs

Archivos en JAVA

Archivos en JAVA

University

12 Qs

Programming Standard Input

Programming Standard Input

University

10 Qs

C++ FILE HANDLING

C++ FILE HANDLING

University

11 Qs

CSE105

CSE105

University

15 Qs

Hadoop

Hadoop

University

11 Qs

N4 Theory - 2

N4 Theory - 2

12th Grade - University

15 Qs

OOP

OOP

University

13 Qs

Adv Java Quiz 1

Adv Java Quiz 1

Assessment

Quiz

Computers

University

Hard

Created by

Omphile Mosingathi

Used 4+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a stream in Java?

A sequence of elements that can be processed sequentially

A type of data structure

A collection of objects

A type of exception

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which package provides the classes for handling streams in Java?

java.util

java.lang

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of byte streams in Java?

To handle characters

To handle primitive data types and files

To handle text files only

To handle large amounts of data in memory

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class is used for reading bytes from a file?

FileReader

BufferedReader

FileInputStream

DataInputStream

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class is used for writing bytes to a file?

FileWriter

BufferedWriter

FileOutputStream

DataOutputStream

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a FileInputStream object to read from a file named "example.txt"?

FileInputStream fis = new FileInputStream("example.txt");

FileInputStream fis = new FileInputStream(new File("example.txt"));

FileInputStream fis = new FileInputStream(new FileInputStream("example.txt"));

d) Both a and b

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method of FileInputStream reads the next byte of data?

readByte()

nextByte()

read()

getByte()

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?