title: Java: "Break" loop from called method?
body: <p>I've got a bit of an issue with my little program.
  I have a <code>JOptionPane</code> asking for a number, and if that number is less than 10, a loop that just continues on and on forever doing what's in it, keeping on asking for numbers. Inside that loop, I call a method, with an int as parameter. In the method, I need to (without altering any of the code in the class that calls the method) find out whether the number I entered is less than 1. If it is, I need to call on another method. That bit's done. </p>
  
  <p>But! The mainloop keeps rolling, so it keeps doing the other stuff in the loop. I need to stop it from doing that, so in the if-statement in the method I need to break that specific iteration of the loop the method is in, and make it go on to a new iteration of the same loop, asking for a new number.</p>
  
  <p>The first class (example):</p>
  
  <pre><code>number=Integer.parseInt( JOptionPane.showInputDialog( "bla bla" ) );
  while (number !=- 10) {
    themethod(number);
    blah
    blah
    ...
  }
  </code></pre>
  
  <p>The called method (example):</p>
  
  <pre><code>public void themethod(int number) {
    if (number&lt;1) {
      call the other method
      break the iteration im in
    }
  </code></pre>