How to use goto statement correctly

前端 未结 8 1778
自闭症患者
自闭症患者 2020-12-02 14:50

I am taking my high school AP Computer Science class.

I decided to throw a goto statement into a one of our labs just to play around, but I got this er

8条回答
  •  悲&欢浪女
    2020-12-02 15:01

    Java also does not use line numbers, which is a necessity for a GOTO function. Unlike C/C++, Java does not have goto statement, but java supports label. The only place where a label is useful in Java is right before nested loop statements. We can specify label name with break to break out a specific outer loop.

提交回复
热议问题