Which line completes this code fragment so it creates a text file called "mychars.txt" and writes the characters 'A', 'B', and 'C' into the file? _____________________
Fw) write('A') ;
Fw) write('B') ;
Fw) write('C') ;
A) PrintWriter fw = new PrintWriter("mychars.txt") ;
B) FileOutputStream fw = new FileOutputStream("mychars.txt") ;
C) File fw = new File("mychars.txt") ;
D) PrintStream fw = new PrintStream("mychars.txt") ;
Correct Answer:
Verified
Q7: Which is an advantage of storing numbers
Q8: The _ class is used when writing
Q9: Which file storage method stores data in
Q10: A byte is composed of _ bits
Q11: To read text data from a disk
Q13: Readers and writers access sequences of _.
A)
Q14: Streams access sequences of _.
A) characters
B) files
C)
Q15: When constructing a Scanner from a File
Q16: In text format, data items are represented
Q17: If you store information in binary form,
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents