Is there a goto statement in Java?

前端 未结 23 2418
醉酒成梦
醉酒成梦 2020-11-22 04:50

I\'m confused about this. Most of us have been told that there isn\'t any goto statement in Java.

But I found that it is one of the keywords in Java. Where can it be

23条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 05:37

    goto is not in Java

    you have to use GOTO But it don't work correctly.in key java word it is not used. http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html

       public static void main(String[] args) {            
                GOTO me;
                //code;
                me:
                //code; 
                }   
       }
    

提交回复
热议问题