clarity needed for the non-sealed keyword

Pravin Jain pravin at zensoftech.co.in
Wed Oct 7 06:25:14 UTC 2020


Dear sir,

consider the following code.
public class TestKeyword {
    int non = 7;
    int sealed = 5;
    int a = non-sealed; // non-sealed not identified as keyword here,
}

In suggested changes to Chapter 3 of the JLS, it does not clarify that
non-sealed will not be tokenized as keyword inside the body of a type
declaration, and I am assumpting that non-sealed classes would not be
allowed inside a type as nested type or local classes.
If in future It is going to be allowed as local class or nested class,
then it may be better to avoid '-' inside a keyword.

I feel clarity is missing on this in the suggested changes to the JLS.

Thanks and regards,
Pravin


--
Pravin Jain
(M)+91-9426054269


More information about the amber-dev mailing list