Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

The mystery of System.out, System.err and System.in  RSS feed

 
Wirianto Djunaidi
Ranch Hand
Posts: 210
Ruby Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy,
I have questions on how those System's Stream come about.
I was just wondering and out of curiosity I open up System.java
src.
In there they declared in, out, and err as static Stream object,
and the way they are initialized is by calling
nullOutpuStream() and nullInputStream() methods.
Well, those methods has nothing but return null or throw
and Exception.
At first I thought those stuff will be native code, since
the input and output will depend on what kind of console
it run on, but it doesn't has any "native" keyword and
made it seems it just automagically there.
I'm just wondering if anybody can explain it to me how
those Streams come about
Thanks,
Ryo
 
Peter Tran
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryo,
If you dig a little deeper you'll see the following:

-Peter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!