Multiple Choice
What does the following code do?
Scanner keyboard = new Scanner(System.in) ;
String filename;
System.out.print("Enter the filename: ") ;
Filename = keyboard.readString() ;
PrintWriter outFile = new PrintWriter(filename) ;
A) It writes to a file named filename.
B) It allows the user to enter the name of the file that data will to be written to.
C) It establishes a connection with a file named filename.
D) Nothing. The code contains a syntax error.
Correct Answer:

Verified
Correct Answer:
Verified
Q9: Given the following statement, which statement will
Q18: The _ loop is ideal in situations
Q20: What will be the value of x
Q22: Assume that inputFile references a Scanner object
Q24: This is an item that separates other
Q26: In all but rare cases, loops must
Q30: When the break statement is encountered in
Q37: The for loop is a posttest loop
Q45: When you pass the name of a
Q51: When working with the PrintWriter class, which