Chris Uppal said:
Seems a bit harsh -- the OP was not criticising Java for not resembling
C++, he was asking why a feature of C++ was deemed unsuitable for Java. [snip]
Asking /why/ something is different is not asserting that it should /not/ be
different.
Taken out of context, I would agree. If the poster had been asking
James Gosling why, it would be completely reasonable. But the poster
was addressing this Usenet newsgroup. Other than Neal Gafter, I don't
think there's anyone here who has any kind of definitive knowledge
about why *any* language choices were made. In context, the use of
"why" by the original poster does not really ask a question, it
indicates annoyance.
If the OP really wants to know why const was omitted from Java, he'll
have to ask Gosling. Or maybe do a Web search, which quickly turned up
this from Joshua Bloch:
"We do not have plans to add support for the const keyword to the
Java language. It was a mixed blessing in C++; as you know, it's
merely advisory, and can cast on or off. Gosling hated it, and did
final instead. What you really want is 'immutable,' but it's a
research problem to make this work properly."
(
http://java.sun.com/developer/community/chat/JavaLive/2003/jl0729.html)
So that looks like the fundamental answer: Gosling hated const.