Search Header Logo

Java File hanteering

Authored by Tina Niekerk

Computers

University

Used 1+ times

Java File hanteering
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does the Path class do?

Creates objects that contain information about files and directories.

Deletes files and directories.

Copies files from one directory to another.

Renames files.

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does the Files class do?

Used to perform operations on files and directories.

Creates new files.

Reads data from files.

Writes data to files.

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does the getNameCount() method return?

The number of name elements in the Path.

The file name.

The directory name.

The full path.

4.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does the getName(int) method do?

Returns name in the position of the Path specified by the integer parameter.

Returns the file name.

Returns the directory name.

Returns the number of name elements.

5.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the syntax to check access for a file?

filepath.getFileSystem().provider().checkAccess();

filepath.checkAccess();

checkAccess(filepath);

AccessMode.check(filepath);

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does the READ argument do in checkAccess()?

Checks if the file exists and permission to read exists

Checks if the file exists and permission to write exists

Checks if the file exists and permission to execute exists

Checks if the file exists

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What happens if the file cannot be used for the application?

An IOException is thrown

The program continues without error

The file is deleted

The file is created

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers