Home > Back-end >  System. The out
System. The out

Time:04-28

PrintStream ps=System. Out; What do you mean? The System. The out object is assigned to the left?
Then ps. Println () and System. Out. The println () what's the difference?
And they're not new PrintSream ps=new PrintStream an object?

CodePudding user response:

refer to the original poster waves rush of small three yes response:
PrintStream ps=System. Out. What do you mean? The System. The out object is assigned to the left?
Then ps. Println () and System. Out. The println () what's the difference?
And they're not new PrintSream ps=new PrintStream an object?


1, the system has a class a static method out, out method of the return value is printstream type, so you can assign it to printstream

2, there is no difference between3, can new an object, but the out way is a standard output stream, Java is used to output to the screen content, here directly use the standard output of the system method, need to set your own new one output object,

CodePudding user response:

Ps and System. The out is the same instance, so ps. The println () with the System. The out the println () is the same, can new PrintStream

CodePudding user response:

PrintStream inherited OutputStream, is an output stream, as for the System. The out should be implemented C/C + + language
  • Related