Java.io - 1

Java.io - 1

1st Grade

5 Qs

quiz-placeholder

Similar activities

UH 3 DPK

UH 3 DPK

1st Grade

10 Qs

HTML - Tags Básicas

HTML - Tags Básicas

1st Grade

10 Qs

Тест на лоха

Тест на лоха

1st - 5th Grade

10 Qs

Event Oriented Programing 1

Event Oriented Programing 1

1st - 5th Grade

5 Qs

4. Clap Activated LED - RoboticSchools

4. Clap Activated LED - RoboticSchools

1st - 5th Grade

10 Qs

Escalamientos FO

Escalamientos FO

1st Grade

10 Qs

QUIZ 10 -  11

QUIZ 10 - 11

1st Grade

5 Qs

Structures-quiz-week3

Structures-quiz-week3

1st Grade

10 Qs

Java.io - 1

Java.io - 1

Assessment

Quiz

Computers

1st Grade

Hard

Created by

Jose Diaz

Used 4+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Identify correct statements about java.io.Console class?. Please select 1 option.

You can read character data from a console but not write to it.

You can read both binary and character data from Console object but you cannot write to it.

You can read both binary and character data from Console object but you can only write character data to it.

You can read as well as write only character data from/to it.

2.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Given:

Path p1 = Paths.get("c:\\a\\b\\c.java");

What will p1.getName(2).toString() return? . Please select 1 option.

a

b

c

c.java

3.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will the following code fragment print?

Path p1 = Paths.get("photos\\..\\beaches\\.\\calangute\\a.txt");

Path p2 = p1.normalize();

Path p3 = p1.relativize(p2);

Path p4 = p2.relativize(p1);

System.out.println( p1.getNameCount()+" "+p2.getNameCount()+" "+ p3.getNameCount()+" "+p4.getNameCount()); Please select 1 option.

6 4 10 10

7 4 11 10

7 3 8 9

6 3 1 1

4.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

What will the following code print?

Path p1 = Paths.get("c:\\temp\\test.txt");

Path p2 = Paths.get("report.pdf");

System.out.println(p1.resolve(p2)); Please select 1 option.

..\report.pdf

c:\temp\test.txt\report.pdf

c:\temp\report.pdf

It will throw an exception.

5.

MULTIPLE CHOICE QUESTION

3 mins • 1 pt

Assuming that the file module-info.java exists in c:\\temp\\src\\foo.bar but not in c:\\temp\\out\\foo.bar and the folder foo.bar exists in c:\\temp\\out, what will happen when the following code is run?

Path p1 = Paths.get("c:\\temp\\src\\foo.bar\\module-info.java");

Path p2 = Paths.get("c:\\temp\\out\\foo.bar");

Files.move(p1, p2); Please select 1 option.

module-info.java will be copied over to out\foo.bar folder.

module-info.java will be moved to out\foo.bar folder.

An exception will be thrown.

module-info.java will be moved to out with the name foo.bar.