
Java File Handling Quiz

Quiz
•
Computers
•
12th Grade
•
Medium

Geoff Ewart
Used 5+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which class in Java is used for file handling?
BufferedReader
File
FileReader
Scanner
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the createNewFile() method return if the file is successfully created?
void
false
null
true
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to check if a file is writable?
write()
isWritable()
canWrite()
canRead()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What exception does the createNewFile() method throw if an error occurs?
FileAlreadyExistsException
NullPointerException
IOException
FileNotFoundException
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method is used to delete a file in Java?
erase()
delete()
remove()
clear()
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the return type of the length() method in the File class?
float
int
long
double
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method returns the absolute pathname of a file?
getAbsolutePath()
getPath()
getFullPath()
getDirectory()
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Sound Representation

Quiz
•
7th - 12th Grade
20 questions
data bases

Quiz
•
12th Grade
13 questions
Binary files in Python

Quiz
•
12th Grade
10 questions
Image File Types

Quiz
•
10th - 12th Grade
12 questions
HTTP protocol and Privacy on the web

Quiz
•
9th - 12th Grade
10 questions
Network Security Risks

Quiz
•
12th Grade
11 questions
APCSP Data vs Metadata

Quiz
•
9th - 12th Grade
20 questions
adobe photoshop 2015 certification quiz 2

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade