2

I tried to do a quick search about this, but nothing specifically answering my question came up. As you might know there are keywords reserved in Java that don't do anything.

  • const
  • goto

What is the purpose of this?

Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
user3758041
  • 179
  • 1
  • 11
  • 2
    Complete answer here: [Java Language Keywords](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html). Only `const` and `goto` are currently reserved but not used. – Jesper Jul 02 '14 at 19:20
  • 2
    http://stackoverflow.com/questions/2545103/is-there-a-goto-statement-in-java – jongusmoe Jul 02 '14 at 19:20
  • 1
    BTW `false`, `true` and `null` are not keywords. – Peter Lawrey Jul 02 '14 at 19:21
  • 1
    Presumably the authors of Java thought that A) they might want to use them in the future, and B) having variables named "const" and "goto" could be very confusing. – Hot Licks Jul 02 '14 at 19:38

1 Answers1

5

These words are keywords in many other languages, and it could be confusing if they were used as identifiers.

Strikeskids
  • 3,932
  • 13
  • 27
  • 1
    From [this answer](http://stackoverflow.com/questions/2545103/is-there-a-goto-statement-in-java#answer-4547764), apparently the original JVM did have `goto` which was removed later. – Nivas Jul 02 '14 at 19:24