Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What Java class is used to create new files?
Think of the class that starts with 'F'.
What method do you use to write data to a file?
It's associated with a specific class for writing.
Which class is used for writing data to files in Java?
It starts with 'File' and is related to writing.
True or False: Scanner can only be used for reading keyboard input in Java.
Think about where else Scanner can read from.
Write a program that reads from a file, counts how many words are in it, and prints the total count.
Remember to use hasNext() rather than hasNextLine() for counting words.
Create a program that ensures a user cannot write to a file unless it exists. If it doesn't exist, prompt the user to create it first.
Incorporate user interaction through the console for creating files.
6 more questions in this section. Enroll free to practise them all.
Enroll free