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


Groups > comp.lang.java.programmer > #30978

Re: super object reference

From Kevin McMurtrie <mcmurtrie@pixelmemory.us>
Newsgroups comp.lang.java.programmer
Subject Re: super object reference
References <maj5b2$1fos$1@ariadne.rz.tu-clausthal.de>
Date 2015-01-31 22:47 -0800
Message-ID <mcmurtrie-08783E.22470031012015@news.sonic.net> (permalink)
Organization Sonic.Net

Show all headers | View raw


In article <maj5b2$1fos$1@ariadne.rz.tu-clausthal.de>,
 Philipp Kraus <philipp.kraus@flashpixx.de> wrote:

> Hello,
> 
> I have got this class structure:
> 
> clas parent
> {
>      int value = 5;
> }
> 
> class child extends parent
> {
> 
>    public doit()
>    {
>           Object x = this.super; **
>    }
> 
> }
> 
> I would like to get at ** a reference to the super object of my class, 
> I need a reference to the full object not to particular methods and 
> properties.
> How can I do this?
> 
> Thanks a lot
> 
> Phil


You have two classes but only one instance object.  There is no parent 
instance.

For proper design, a child class must not contradict the declared API of 
the parent class.  There's refactoring needed if it does.  For example, 
LinkedHashMap does not behave in any way that contradicts the declared 
API of HashMap.

Maybe you're thinking of inner/outer classes?  An outer class is 
OuterClassName.this.

-- 
I will not see posts from astraweb, theremailer, dizum, or google
because they host Usenet flooders.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

super object reference Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-01-31 19:02 +0100
  Re: super object reference Jeff Higgins <jeff@invalid.invalid> - 2015-01-31 13:14 -0500
  Re: super object reference Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-01-31 22:47 -0800
    Re: super object reference Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-02-01 12:40 +0100
      Re: super object reference Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 09:13 -0500
        Re: super object reference Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 09:21 -0500
          Re: super object reference Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-02-01 23:44 +0100
      Re: super object reference Jeff Higgins <jeff@invalid.invalid> - 2015-02-01 09:23 -0500
        Re: super object reference Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 09:30 -0500
      Re: super object reference Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2015-02-02 19:46 -0800
  Re: super object reference Roedy Green <see_website@mindprod.com.invalid> - 2015-02-05 04:37 -0800

csiph-web