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
Q30: Consider the following code snippet. Scanner inputFile
Q31: Which of the following statements about exception
Q32: Insert the missing code in the following
Q33: Consider the following code snippet: throw IllegalStateException("This
Q34: Which String class method will remove spaces
Q36: Your program must read in an existing
Q37: Which of the following code snippets about
Q38: Consider the following code snippet: try<br>{<br>File inputFile
Q39: Assume that inputFile is a Scanner object
Q40: Which method of an exception object will