Reputation:
I have noticed that there is the const
keyword in Java. It reminded me of things like static
and final
variables there.
But why was it created without anyone actually using it?
Upvotes: 3
Views: 2010
Reputation: 310893
From the JLS #3.9:
The keywords
const
andgoto
are reserved, even though they are not currently used. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in programs.
Upvotes: 11