Results 1 to 4 of 4
- 01-22-2012, 10:19 PM #1
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Confused about 'out's in System class and PrintStream class
Class System has a Class variable called out:
public static final PrintStream out
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user.
and there is a instance variable 'out' in PrintStream class:
out
protected OutputStream out
The underlying output stream to be filtered.
Is there any sort of connection between them ?
- 01-23-2012, 04:36 AM #2
Re: Confused about 'out's in System class and PrintStream class
Forget about the variable/field names. They don't exist at runtime.
System has a static field of type PrintStream.
That PrintStream, being a PrintStream, has an instance field of type OutputStream.
Do you still have a question?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 01-23-2012, 07:26 AM #3
Senior Member
- Join Date
- Nov 2011
- Location
- Turkey
- Posts
- 378
- Blog Entries
- 24
- Rep Power
- 2
Re: Confused about 'out's in System class and PrintStream class
System has a static field of type PrintStream.
That PrintStream, being a PrintStream, has an instance field of type OutputStream.
but the inctance field of type OutStream has nothing to with the static field of type PrintStream has, right ?
- 01-23-2012, 11:13 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Confused about 'out's in System class and PrintStream class
Of course it does.
It's an attribute of that PrintStream.
In fact it is the stream that is written to when you make calls to the PrintStream methods.
That Stream might itself wrap another stream, and so on, but that is all implementation details and shouldn't really affect how you use the PrintStream.
Similar Threads
-
Calling a method from another class? *confused and stressed*
By Illanair in forum New To JavaReplies: 16Last Post: 01-16-2012, 10:47 PM -
A little confused (class variable scope?)
By Vase in forum New To JavaReplies: 11Last Post: 02-03-2011, 02:51 AM -
Calling a class and a little confused
By Boomer1 in forum New To JavaReplies: 1Last Post: 12-29-2009, 06:10 PM -
Yet another Wrapper Class confused guy.
By JAdeline in forum New To JavaReplies: 2Last Post: 08-15-2008, 04:04 AM


1Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks