Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What class is used to represent file paths in the java.nio.file package?
This class is not just a string; it has methods to handle paths.
How do you obtain a Path object from a string?
It's a static method from the utility class.
Which class is NOT part of the java.nio.file package?
Think about the organization of these classes in packages.
The Paths class is a utility to create Path instances.
Consider what utility classes generally provide.
Write a complete Java program to read a file, count the number of lines, and print them to the console, handling any exceptions that may occur.
Don't forget to add exception handling.
Modify the previous program to create a new file and write the contents of the original file into it, combining them into one.
Ensure the target file is created without overwriting existing files.
5 more questions in this section. Enroll free to practise them all.
Enroll free