“Goto” — label in Java

There is no goto in Java, but goto is a reserved word. For example, int goto; It's illegal.

However, there are tags in Java, which only work in the continue and break of multiple loops.

Continue and break can only work on this layer of loops, but with tags, you can directly jump out of multiple loops.

Code example:

Output:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>