One, standard output stream System.out
System.out output data to standard output devices in a number of ways:
The main difference between print () and println () is that the latter output is not a career change, printf () is mainly formatted output
One, standard input stream system.in
System.in reads standard input device data (obtains data from standard input, usually keyboard) int read ()//returns ASCII code. If, the return value =-1, indicates that no read to any byte read work ends.
int read (byte[] b)//Read in multiple bytes to buffer b The return value is the number of bytes read in
Public classInput { Public Static void Main(String args[]) {intbTry{System. out. println ("Please Input:"); while((b = System.)inch. read ())! =-1) {//system.in.read ()System. out. Print (Char) b); } }Catch(IOException e) {System. out. println (E.tostring ()); } } }//console input What, press ENTER key will output what
Thirdly, various input streams and various output streams of the Java.io Stream class library
Inheritance relationship
There are more input streams and output streams in Java, we generally only need to master 17 kinds of
fileinputstream//file byte output stream
fileoutputstream//file byte output stream
FileReader//file character input stream
FileWriter//file character output stream
bufferedreader//Cache character Input stream
bufferedwriter//Cache Character Output stream
bufferedinputstream//Cache byte Input stream
bufferedoutputstream//Cache byte output stream
datainputstream//Data input Stream
dataoutputstream//Data output stream
objectinputstream.//Object Input Stream
objectoutputstream//Object Output stream
printwriter//print output stream, a previous article introduced
Each input stream is explained in the following article
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java standard stream input output stream in (out) Putstream,readerwriter etc summary (1)