Java Coding standard / best practices - naming convention for break/continue labels

前端 未结 10 2360
难免孤独
难免孤独 2020-12-15 05:36

Sometimes a labeled break or continue can make code a lot more readable.

OUTERLOOP: for ( ;/*stuff*/; ) {
    //...lots of code

    if ( isEnough() ) break         


        
10条回答
  •  不知归路
    2020-12-15 06:21

    The convetion/best practise would still be not to use them at all and to refactor the code so that is more readable using extract as method.

提交回复
热议问题