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 method is used to create a new file?
It's a method of the File class.
What do you need to handle when creating files in Java?
Consider what might go wrong during file operations.
Which method is used to attempt file creation in Java?
Think about the method name that suggests creating.
True or False: If a file created using createNewFile() already exists, the method will create a new file.
Consider the definition of 'existing'.
Create a Java program that takes a file name from user input, attempts to create it, and handles any exceptions gracefully. What steps will you include?
Start with getting user input and remember to import Scanner.
Explain how to create a file in a directory that is not write-protected. What issues may arise if the directory permission changes?
Focus on the implications of directory permissions.
4 more questions in this section. Enroll free to practise them all.
Enroll free