Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3694

Re: a very tricky questio

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Lew" <lew@THRWHITE.remove-dii-this>
Subject Re: a very tricky questio
Message-ID <5M6dnZkXwdZeP8LVnZ2dnUVZ_uadnZ2d@comcast.com> (permalink)
X-Comment-To comp.lang.java.gui
Newsgroups comp.lang.java.gui
In-Reply-To <b76ddfb5-f084-4adc-adf0-7e40ed824b66@q27g2000prf.googlegroups.co
References <b76ddfb5-f084-4adc-adf0-7e40ed824b66@q27g2000prf.googlegroups.co
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 38
Date Wed, 27 Apr 2011 15:46:22 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303919182 96.60.20.240 (Wed, 27 Apr 2011 10:46:22 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:46:22 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.gui:3694

Show key headers only | View raw


  To: comp.lang.java.gui
birensubudhi@gmail.com wrote:
> In java [sic] in object only the nonstatic members are present & the static
> members donot reside in the object but we are accessing static members
> using object reference technique.

The static member still has to reside somewhere.  It isn't in limbo.  Static 
members reside in the class itself.  The class is like an object itself - it 
has member references and member methods, those marked 'static' in the class 
definition.

> since the static member do not reside in the object 

There is no "the object".  Static members reside in another object, the one 
representing the class itself.

> then how we are accessing it using object reference...

Two different things, objects and references.

Objects referred to by instance members don't "reside in the object" either. 
A reference lives inside an object, either in an instance object or the class 
itself.  The reference points to another object or to 'null'.  The referenced 
object doesn't "reside in" anything but heap, conceptually.

Classes and instances don't have member objects.  They have member references. 
  References point to objects.  Objects don't "reside in" other objects. 
References do, sometimes, but not necessarily in instance objects.  The place 
from which a reference points and the place to which it points are two 
different things.

-- 
Lew

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | Next | Find similar | Unroll thread


Thread

Re: a very tricky questio "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000

csiph-web