The Java keyword list specifies the goto
keyword, but it is marked as "not used".
It was in the original JVM (see answer by @VitaliiFedorenko), but then removed. It was probably kept as a reserved keyword in case it were to be added to a later version of Java.
If goto
was not on the list, and it gets added to the language later on, existing code that used the word goto
as an identifier (variable name, method name, etc...) would break. But because goto
is a keyword, such code will not even compile in the present, and it remains possible to make it actually do something later on, without breaking existing code.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…