IO Flashcards
What package use for input/output?
import java.io*
What buffering
Java will create intermediate memory called buffer which does reading and writing in the background. If not, then program would have to read one character at a time. This adds efficency
illustration of buffering
What is flushing?
force buffer to write to the file and wont return until its done. Ensures data is on the file before moving on
Byte streams are for what?
Bytes, for binary data. Good for non-text data
Explain character streams and what good for?
text files
What are the 3 predefined streams in java
system.in
system.out
system.err
Does JVM consider Console a byte device?
yes
Scanner is a common Console class. T/F?
yes
Scanner class.
import java.util.scanner
Intro to Files
T/F opening a file for writing will create a new file if it doesnt exist?
true
Writnig and updating files pic
close files after done to save space
What id buffered classes
wrapper class around i/o methods, to use buffer which adds efficeincy
why use try with resource statments
auto-close the file at exit of the try