Java File Handling Quiz

Java File Handling Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Chapter 6 Cascading Style Sheets

Chapter 6 Cascading Style Sheets

9th - 12th Grade

20 Qs

Methods (Basic)

Methods (Basic)

9th - 12th Grade

10 Qs

CompTIA Chapter 15 - Developing and Implementing Software

CompTIA Chapter 15 - Developing and Implementing Software

10th - 12th Grade

10 Qs

Checkpoint 212: Internet Data Transmission

Checkpoint 212: Internet Data Transmission

12th Grade

10 Qs

Intro to Microsoft Access

Intro to Microsoft Access

10th - 12th Grade

20 Qs

Java Kena Mental

Java Kena Mental

12th Grade

20 Qs

20.2 File Processing and Exception Handling Cambridge iA 9618

20.2 File Processing and Exception Handling Cambridge iA 9618

12th Grade

20 Qs

POST TEST PBO

POST TEST PBO

12th Grade

15 Qs

Java File Handling Quiz

Java File Handling Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

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

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?