Java File hanteering

Java File hanteering

University

15 Qs

quiz-placeholder

Similar activities

Linux Directory Structures

Linux Directory Structures

10th Grade - University

20 Qs

Web Systems and Technologies

Web Systems and Technologies

University

20 Qs

Commanding the Command Line Quiz

Commanding the Command Line Quiz

University

15 Qs

Chapter 2 : Basic Concept Operating System Management

Chapter 2 : Basic Concept Operating System Management

University

10 Qs

DIS08_1_Shell

DIS08_1_Shell

University

10 Qs

ICT315- 20SSL6142

ICT315- 20SSL6142

University

10 Qs

6thApril

6thApril

University

10 Qs

Linux Commands

Linux Commands

University

11 Qs

Java File hanteering

Java File hanteering

Assessment

Quiz

Computers

University

Medium

Created by

Tina Niekerk

Used 1+ times

FREE Resource

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

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?