Solved

What Does the Following Code Do? Scanner Keyboard = New

Question 15

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions