U1. Files and Serialization

U1. Files and Serialization

University

17 Qs

quiz-placeholder

Similar activities

File Handling in Python, Serialization in Python

File Handling in Python, Serialization in Python

University

15 Qs

Day 10 - ONLINE TEST - PL03 PYTHON PROGRAMMING

Day 10 - ONLINE TEST - PL03 PYTHON PROGRAMMING

University

20 Qs

File Handling in C++

File Handling in C++

12th Grade - University

20 Qs

PYTHON PROGRAMMING FILES Q7

PYTHON PROGRAMMING FILES Q7

University

20 Qs

Basic Computer Architecture Quiz

Basic Computer Architecture Quiz

University

20 Qs

Online Test-3 ( Wipro Talent Next )- 30th July 2020

Online Test-3 ( Wipro Talent Next )- 30th July 2020

University

20 Qs

C Basics

C Basics

University

12 Qs

TY A Web Technologies -II (Chapter 1 and 2) Quiz

TY A Web Technologies -II (Chapter 1 and 2) Quiz

University

12 Qs

U1. Files and Serialization

U1. Files and Serialization

Assessment

Quiz

Computers

University

Easy

Created by

Héctor L

Used 19+ times

FREE Resource

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the key difference between text and binary files?

Text files store data as bytes, while binary files store characters.

Text files are human-readable, while binary files are not.

Binary files are faster to read, while text files are less efficient.

Binary files cannot be opened on certain operating systems.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following classes is used to read lines from a text file in Java?

FileWriter

BufferedReader

DataInputStream

ObjectInputStream

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the code in the image do?

Write the string "Hello, world!" to output.txt.

Throw an exception because BufferedWriter cannot be closed before FileWriter.

Write a single character 'H' to output.txt.

Create the file output.txt but not write anything to it.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method in FileInputStream is used to read a single byte from a binary file?

readLine()

read()

readByte()

getByte()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Serialization in Java requires which interface to be implemented?

Serializable

Serializate

IOSerializate

IOSerializable

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What exception is thrown if a file does not exist when using FileInputStream?

NullPointerException

FileNotFoundException

IOException

StreamCorruptedException

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following line of code do?

output.writeObject(object);

Writes a character to the file.

Writes an object to the file after converting it to bytes.

Saves a text representation of the object.

Appends an object to an existing file.

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?