Consider the following code snippet.
PrintWriter outputFile = new PrintWriter("payrollReport.txt") ;
Which of the following statements about the PrintWriter object is correct?
A) If a file named "payrollReport.txt" already exists, a new file named "payrollReport_1.txt" will be created and used.
B) If a file named "payrollReport.txt" already exists, an exception will occur.
C) If a file named "payrollReport.txt" already exists, existing data will be deleted before new data are added to the file.
D) If a file named "payrollReport.txt" already exists, new data will be added to the end of the file.
Correct Answer:
Verified
Q30: Insert the missing code in the following
Q31: Assuming that inputFile is a Scanner object
Q32: Which of the following statements about character
Q33: Your program wishes to open a file
Q34: Which return value of the JFileChooser object's
Q36: Consider the following code snippet.
Scanner inputFile =
Q37: Your program must read in an existing
Q38: Which of the following statements about reading
Q39: Which Java class implements a file dialog
Q40: Consider the following code snippet.
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents