1
Concept
What is the main difference between storing data in RAM vs storing data in a file?
2
File Types
Which of the following is a text-based (human readable) file?
3
File Class
What does this code do?
File myFile = new File(
"data.txt"
);
4
Paths
Which is an example of a relative path?
5
File Methods
Which method checks if a file exists on disk?
6
Scanner
What exception must be handled when creating a Scanner with a File?
7
Scanner Methods
What is the difference between
next() and nextLine()?
8
PrintWriter
What happens if you create a PrintWriter for a file that already exists?
9
Buffers
Why is it important to call
close() on a PrintWriter?
10
Code Analysis
What will be in output.txt after this code runs?
PrintWriter writer = new PrintWriter(
"output.txt"
);
writer.print("Hello");
writer.println(" World");
writer.print("Java");
writer.close();
Quiz Complete!
0/10