Equivalent of goto of c++ in Java in a specific scenario
<p>I am replacing a old C++ code with Java:I know there is no equivalent of goto in java as it causes many surprising errors and unintended loop terminations.</p>

<p>C++ code: //I have skipped the actual code</p>

<pre><code>for(//some condition){

  if (excl(grds[i],0)) 
   {
       //do something 
       goto breakout;
   }
   //some more code
breakout:
   //rest of the code
}//end of for loop
</code></pre>

<p>Java representation:</p>

<pre><code>for(//some condition){

  if (excl(grds[i],0)) 
   {
      //do something 
   }
  else
   {
   //some more code
   }

   //rest of the code
}//end of for loop
</code></pre>

<p>I have kept the "some more code" part in the else section so I guess it will function same as the breakout. When the if condition is true it wont go to the else part and rest of the code will be executed as usual. I guess break or continue wont serve the purpose as we need to any way run the rest of the code section for all iterations.</p>

<p>Is this the correct way of representing this C++ code in Java? </p>
