U1. Files and Serialization
Quiz
•
Computers
•
University
•
Practice Problem
•
Easy
Héctor L
Used 19+ times
FREE Resource
Enhance your content in a minute
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
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.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
Python Recap
Quiz
•
7th Grade - University
12 questions
Kuiz Komputer dan ICT
Quiz
•
1st Grade - University
12 questions
Python Quiz 1.4
Quiz
•
University
20 questions
Chapter 3: Strategic Initiatives for implementing CA
Quiz
•
University
20 questions
ป.4 แบบทดสอบปลายภาคเรียนที่ 2/2567 ชุดที่ 1
Quiz
•
4th Grade - University
13 questions
Processing Quiz
Quiz
•
University
15 questions
Pengolahan Citra IK-1 10.45
Quiz
•
University
14 questions
Apple quiz
Quiz
•
5th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
