Multiple Choice
Insert the missing code in the following code fragment. This fragment is intended to read a file and write to a file.
Public static void main(String[] args) throws FileNotFoundException
{
String inputFileName = "dataIn.txt";
String outputFileName = "dataOut.txt";
File inputFile = new File(inputFileName) ;
Scanner in = new Scanner(inputFile) ;
PrintWriter out = _____________;
) . .
}
A) new PrintWriter(outputFileName)
B) new Scanner(outputFileName)
C) new PrintWriter(outputFile)
D) new Scanner(outputFile)
Correct Answer:

Verified
Correct Answer:
Verified
Q2: Which of the following statements about using
Q25: Which statement about handling exceptions is true?<br>A)
Q45: Insert the missing code in the following
Q54: Insert the missing code in the following
Q58: Under which condition will the PrintWriter constructor
Q59: Which of the following patterns should be
Q74: If the current method in a program
Q86: Consider the following code snippet. Scanner inputFile
Q92: Consider the following code snippet: Scanner in
Q102: Consider the following code snippet. PrintWriter outputFile