Top Posters
Since Sunday
g
3
3
2
J
2
p
2
m
2
h
2
s
2
r
2
d
2
l
2
a
2
New Topic  
Oughto Oughto
wrote...
Posts: 742
Rep: 1 0
7 years ago
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 establishes a connection with a file named filename.
B) It allows the user of the program to enter the file name of the file he/she wants to write to.
C) It writes to a file named filename.
D) Nothing, there is a syntax error.
Textbook 
Starting Out with Java: Early Objects

Starting Out with Java: Early Objects


Edition: 4th
Author:
Read 225 times
3 Replies
Replies
Answer verified by a subject expert
ToothyToothy
wrote...
Top Poster
Posts: 744
Rep: 4 0
7 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here
1

Related Topics

Oughto Author
wrote...
7 years ago
makes a lot more sense, thanks for the help
wrote...
7 years ago
Good luck tackling the rest
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1131 People Browsing
 106 Signed Up Today
Related Images
  
 1822
  
 161
  
 256
Your Opinion