
Java.io - 1
Authored by Jose Diaz
Computers
1st Grade
Used 4+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
PROGRAMACION MODULAR DE VECTORES Y MATRICES
Quiz
•
1st - 5th Grade
10 questions
What is the Internet
Quiz
•
1st - 2nd Grade
10 questions
Intro to Mobile Programming Quiz
Quiz
•
1st - 10th Grade
10 questions
Quiz sobre HTML e CSS
Quiz
•
1st Grade - University
10 questions
Quiz ADT linked list 20-12-66
Quiz
•
1st Grade
10 questions
React 3
Quiz
•
1st Grade
10 questions
The Internet: Addressing, Routing, and Reliability
Quiz
•
KG - 12th Grade
10 questions
INTRODUCTION TO OOP
Quiz
•
1st - 3rd Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Telling Time to the Hour and Half hour
Quiz
•
1st Grade
10 questions
Exploring Rosa Parks and Black History Month
Interactive video
•
1st - 5th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
13 questions
Fractions
Quiz
•
1st - 2nd Grade
20 questions
CVC Words
Quiz
•
KG - 1st Grade
15 questions
Place Value tens and ones
Quiz
•
1st Grade
16 questions
Money - Coins
Lesson
•
1st - 2nd Grade
20 questions
Halves and Fourths
Quiz
•
1st Grade