The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

An inner class inherit another inner class

Posted by MaBo on October 24, 2000 at 1:59 AM

Hi,all
I got a problem on Java inner class inheritation.See,
public class A
{
public class InnerInA
{
public InnerInA(X x)
{...}
}

public A()
{sth valueble...}
}
public class B extends A
{ A parent = null;

public class InnerInB entends A.InnerInA
{
InnerInB(X x)
{ //must get a ref of the outer class of InnerInA
parent.super(x);
}
}
public B()
{
super();
parent=new A();
}
}
Is it correct? if it's not,what's wrong? if you think it's correct,why can't I compile it? what I get are:1 you should use "this" (this.parent.super(x)in constructor of InnerInB)2.cannot parse this sentence. I use JDK 1.3.
Thank you in advance.

yours MaBo



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us