Kontorotsui wrote:
> 
> aClass extends aSuperClass
> {
>   final int v = 1;
> 
>   aClass()
>   {
>      super(v);
>   }
> }

First off, my understanding of the question is why doesn't v exist when
passed into super. "super" is not a method call like everything else. 
It is a special keyword and a way to specify constructor
initialization.  What it tells the compiler is to use the contructor
that takes an integer in the aSuperClass.  Construction then takes place
from the highest top parent down to the concrete child.  In your case,
the type is right, but v does not exist yet until aSuperClass
initializes. The "final" keyword tells the runtime that this value will
not be changed once it is set.  So the one person who mentioned using a
"static int v = 1", is probably the way you want to go.

Hope that helps,
Dave


-- 

+------------------------------------------------------------+
| David Lucas                      mailto:[EMAIL PROTECTED]    |
| Lucas Software Engineering       (614) 260-5970            |
| Unix,C++,Java,Client/Server,CORBA                          |
+------------------------------------------------------------+
| GPS Location:      40 deg 00' 51" N,  82 deg 38' 11" W     |
| IMHC: "Jesus Christ is the way, the truth, and the life."  |
| IMHC: "I know where I am; I know where I'm going."         |
+------------------------------------------------------------+

Notes:
IMHO: in my humble opinion   IMHC: in my humble conviction 
PGP Key Block:  finger [EMAIL PROTECTED]
All trademarks above are those of their respective owners.


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to