Insert the missing code in the following code fragment. This fragment is intended to read an input file named dataIn.txt and write to an output file named dataOut.txt.
Public static void main(String[] args) throws FileNotFoundException
{
String inputFileName = "dataIn.txt";
String outputFileName = "dataOut.txt";
File inputFile = _________________;
Scanner in = new Scanner(inputFile)
) . .
}
A) new File(inputFileName)
B) new File(outputFileName)
C) new File(inputFile)
D) new File(System.in)
Correct Answer:
Verified
Q1: Consider the following code snippet: PrintWriter out
Q3: Which of the following statements about using
Q5: Under which condition will the Scanner constructor
Q6: Your program will read in an existing
Q7: Which of the following statements reflects the
Q9: Which of the following is the correct
Q11: Which of the following objects should be
Q14: Under which condition will the PrintWriter constructor
Q16: The PrintWriter class is an enhancement of
Q19: Consider the following code snippet. File hoursFile
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