java source code reading System

Type 1 Signatures and Notes

public final class System

The System class contains some useful class properties and methods. This class cannot be instantiated.

 

2 standard input and output streams

public final static InputStream in = null;

public final static PrintStream out = null;

Standard input and output streams are initialized in the initializeSystemClass method.

(1) Console input and output

1 Scanner in = new Scanner(System.in);  
2 System.out.println(in.nextLine());  

When the code runs to line 1, it will wait for the user to input in the console, and then pass the println method of out.

unfinished

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325647097&siteId=291194637