Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java - what is the stream of PrintStream of the System.out?

Tags:

java

I want to understand java streams.

The code :

System.out.println(System.out.getClass().getCanonicalName())

outputs

java.io.PrintStream

As I understood PrintStream is the wrapper of another stream to add functionality of formating. But I can't understand what is the stream class that is wrapped by PrintStream? Is this Console? And how to check it - from PrintStream API I didn't find any suitable method.

like image 672
Pavel_K Avatar asked Mar 12 '23 21:03

Pavel_K


1 Answers

This is the point of having an API. At some level, the actual "stream" becomes OS and platform dependent. But Java has been set up so that you don't have to worry about such things

like image 83
ControlAltDel Avatar answered Mar 23 '23 06:03

ControlAltDel