(CSCI 2010 - Quiz 8: 2026 Questions and Answers)
Data in a file remains after program execution ends. True
A statement opening a text file for reading or writing True
may generate a FileNotFoundException.
Which of the following is the correct way to open a inputStream = new Scanner(new File("myfile.txt"));
text file called "myfile.txt" for reading?
Which Java class is the preferred class to use for Scanner
reading from a text file?
Which of the following is not a method of the File close()
class?
What is the difference between a full path name and a A full path name starts at the root directory while a relative path name starts
relative path name? at the directory in which the program is running.
Which Java class is the preferred class to use for PrintWriter
writing to a text file?
3/30/2026, 5:31:26 PM 3/30/2026, 5:31:25 PM 3/30/2026, 5:31:22 PM
Data in a file remains after program execution ends. True
A statement opening a text file for reading or writing True
may generate a FileNotFoundException.
Which of the following is the correct way to open a inputStream = new Scanner(new File("myfile.txt"));
text file called "myfile.txt" for reading?
Which Java class is the preferred class to use for Scanner
reading from a text file?
Which of the following is not a method of the File close()
class?
What is the difference between a full path name and a A full path name starts at the root directory while a relative path name starts
relative path name? at the directory in which the program is running.
Which Java class is the preferred class to use for PrintWriter
writing to a text file?
3/30/2026, 5:31:26 PM 3/30/2026, 5:31:25 PM 3/30/2026, 5:31:22 PM