Have you tried using "static final int v = 1;" instead?
-Andy
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Kontorotsui
> Sent: Wednesday, July 14, 1999 12:41 PM
> To: [EMAIL PROTECTED]
> Subject: final variables in constructors
>
>
<...Snip...>
>
>
> If instead I write
>
> aClass extends aSuperClass
> {
> final int v = 1;
>
> aClass()
> {
> super(v);
> }
> }
>
> with the same superclass, I get a "Can't reference v before the superclass
> constructor has been called." error from the compiler.
>
> I understand that in general a variable cannot be referenced before the
> superclass constructor was called, but if that variable is a
> final, then it's a constant, why does the compiler complains?
> The two pieces of code are, semanthically, the same, aren't they?
> The javac pre-processor could even substitute the constant values before
> compiling!
>
> It's the java language that is excessively pedantic or there is
> something I'm missing?
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]