title: Does break statement inside if inside while finish "while loop" completely or only immediate "if"?
body: <p>I have this code, that caused me error. The code goes through list and sees if any user is logged in, if it is logged in it counts which user it is - first or second. </p>
  
  <p>When i placed that break statement inside if, the loop only found the first user and did not do anything about 2nd user - <strong>the entire loop was ending!</strong> How so? I thought the break only works for the immediate block it is placed within, i.e. if break is in if{}, it breaks out of this if and the code execution continues.</p>
  
  <p>Does break statement end even the outside loops? </p>
  
  <pre><code>            do {
              if (userlogin){
                  if(how_many_logged_in == 0){
                      name1.setVisibility(View.INVISIBLE);
  
                  }
                  else if(how_many_logged_in == 1){
  
                      name2.setVisibility(View.INVISIBLE);
  
                      break ; //this is confusing - where does it break from?                  
                  }
              }
          } while (condition);
  </code></pre>