3 ms·
wouldn't this be true any time an English language keyword is added to a language?
by dmead 7y ago
wouldn't this be true any time an English language keyword is added to a language?
- Macha 7y agoYes. It's not a very frequent occurrence. Here are all new keywords added to the language: Java 2: strictfp Java 4: assert Java 5: enum Java 9: module, requires Java 13: yield Java 15: record Now my local Java dev env is only Java 8, but I'm not allowed declare String enum = "foo"; which would have been valid prior to its addition as a keyword.
- Reason077 7y agoAlthough enums weren't introduced until Java 5, enum was always a reserved word in Java. module, requires, yield, and record are not reserved words, and can still be used as names for members etc.
- _old_dude_ 7y ago> enum was always a reserved word in Java Nope, i had to patch a bunch of codes because enum was not a reserved keyword until it was introduced in Java 5.
- chrisseaton 7y ago> enum was always a reserved word in Java This isn't true. It isn't listed in the list of keywords in Section 3.9 of the 1996 Java specification.
- Reason077 7y agoMy apologies, you are right. I was confusing it with const, which has always been a reserved word (despite never being used).