Solved

Insert the Missing Code in the Following Code Fragment

Question 49

Multiple Choice

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions