Insert the missing code in the following code fragment. This fragment is intended to read an input file named dataIn.txt that resides in a folder named payroll on the C: drive of a Windows system. public static void main(String[] args) throws FileNotFoundException
{
File inputFile = ________;
Scanner in = new Scanner(inputFile) ;
) . .
}
A) new File(c:/payroll/"dataIn.txt")
B) new File(c://payroll//"dataIn.txt")
C) new File("c:\payroll\dataIn.txt")
D) new File("c:\\payroll\\dataIn.txt")
Correct Answer:
Verified
Q19: Consider the following code snippet. File hoursFile
Q20: Consider the following code snippet: File inputFile
Q21: Which of the following statements about reading
Q22: Insert the missing code in the following
Q23: Insert the missing code in the following
Q25: Which of the following statements about reading
Q26: Which return value of the JFileChooser object's
Q27: Your program must read in an existing
Q28: Consider the following code snippet. PrintWriter outputFile
Q33: Your program wishes to open a file
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