Multiple Choice
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 = new File(inputFileName) ;
Scanner in = _________;
) . .
}
A) new File(inputFileName)
B) new File("dataIn.txt")
C) new Scanner(inputFile)
D) new Scanner("dataIn.txt")
Correct Answer:

Verified
Correct Answer:
Verified
Q7: Insert the missing code in the following
Q11: Consider the following code snippet: Scanner in
Q27: Consider the following code snippet: System.out.printf("%-12s%8.2f",description,totalPrice);<br>Which of
Q28: Consider the following code snippet:<br>Throw IllegalStateException("This operation
Q30: Consider the following code snippet:<br>Try<br>{<br>PrintWriter outFile =
Q31: Consider the following code snippet:<br>Try<br>{<br>File inputFile =
Q37: Which of the following code snippets about
Q40: Which method of an exception object will
Q50: In the hierarchy of Exception classes, the
Q108: Consider the following code snippet: PrintWriter out