const VS static final class variable ?

Brendan Eich brendan at
Fri Aug 17 15:37:04 PDT 2007

On Aug 17, 2007, at 1:10 PM, Garrett Smith wrote:

> what is the difference between x1 and x2?
> class A {
>    const x1;
>    static final x2;

You need a var before x2. Also you can't add final except before  
classes and methods (the reference implementation currently parses  
'class A { static final var x; }' but that's a bug).

Are you thinking of Java, or some other language here? If this is  
based on an ES4 example or spec, can you cite the URL?

The obvious difference, ignoring the intended illegality of static  
final var x2, is that x2 is static, so per class, not per instance.


More information about the Es4-discuss mailing list