Labeled Statement block in Java?

后端 未结 4 1213
后悔当初
后悔当初 2020-11-29 11:39

I was browsing through some of the base Java objects when I found a section of code surrounded by a scan: {} block. The following code is from the toLowerCase()

4条回答
  •  渐次进展
    2020-11-29 12:09

    It is a label. It is a indicator for flow control.

    If you look at your code, you see below

     break scan;
    

    When this happens, the flow exits completely the scan block.

    By the way, it can be any identifier, scan is not a keyword at all.

提交回复
热议问题