Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What class is used to write to a file in Java?
It's part of the Java I/O classes.
True or False: You must close the PrintWriter after writing to a file.
Think about data integrity.
What is the purpose of the PrintWriter class?
Think about what you do when you want to keep a note.
True or False: FileWriter can be used to read from a file.
Consider what the name implies.
Write a Java program that creates a file, writes ten random numbers to it, and handles any IOException that may occur.
Remember to handle exceptions properly.
Modify the previous program to append a new set of ten random numbers to the same file without overwriting it.
Think about how appending is different from writing.
3 more questions in this section. Enroll free to practise them all.
Enroll free