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 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
Q18: How many times will the following do-while
Q22: The _ loop is ideal in situations
Q26: Select all that apply. Which of the
Q34: A _ is a value that signals
Q40: A(n) _ is a special value that
Q42: A file must always be opened before
Q43: What will be the value of x
Q45: When you pass the name of a
Q49: What will be the value of x
Q53: Which of the following is the method