[1611] in java-interest

home help back first fref pref prev next nref lref last post

question about static variables

daemon@ATHENA.MIT.EDU (John D. Mitchell)
Sun Sep 10 08:27:50 1995

Date: Sun, 10 Sep 1995 01:12:39 -0700
From: "John D. Mitchell" <johnm@emf2-003.emf.net>
To: jsw@cs.brown.edu
Cc: java-interest@java.sun.com
In-Reply-To: <199509100210.WAA19472@lippitt.cs.brown.edu>

Jeff White writes:
> Are public static variables inherited in subclasses?  I would think
> that since they're static and refer to the class itself - not
> instances, that they would not be inherited.  When I try to override a
> pubic static final static variable I get no error in compiling my java
> source.

Didn't we just talk about this...

Well anyways, just 'static' is quite different from 'static final'.  Get
rid of the 'final' and you should be able to override the value.


[...]
> So, either way, it seems that either javac should complain, or javah
> shouldn't do the parental #defines.

Me thinks javac should complain about the attempt to override a 'final'
variable.

Take care,
	John
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post