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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With