
Java.io - 1
Quiz
•
Computers
•
1st Grade
•
Hard
Jose Diaz
Used 4+ times
FREE Resource
Enhance your content
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.
Similar Resources on Wayground
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
Discover more resources for Computers
11 questions
NFL Football logos
Quiz
•
KG - Professional Dev...
18 questions
D189 1st Grade OG 1c Concept 37-38
Quiz
•
1st Grade
20 questions
addition
Quiz
•
1st - 3rd Grade
20 questions
Subject and predicate in sentences
Quiz
•
1st - 3rd Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
10 questions
Exploring Force and Motion Concepts
Interactive video
•
1st - 5th Grade
10 questions
Exploring Properties of Matter
Interactive video
•
1st - 5th Grade
5 questions
Sense and Response
Quiz
•
1st Grade