title: Java - While loop where all conditions must be false for it to exit
body: <p>First of all is this possible? Second of all if it is how can it be done? Im trying to get the following code to work like that but even if one of the variables is 0 it exits the loop, it needs to be made that all 3 variables are less than 1 for it to exit</p>
  
  <pre><code>import java.util.Scanner;
  
  public class BabyNim
  {
      public static void main(String[] args)
      {
          Scanner keyboard = new Scanner(System.in);
  
          int a, b, c, input;
          String pile;
  
          a = 3;
          b = 3;
          c = 3;
  
          System.out.println("A: " + a + "\tB: " + b + "\tC: " + c);
  
          while (a &gt; 1 &amp;&amp; b &gt; 1 &amp;&amp; c &gt; 1)
          {
              System.out.print("Pile: ");
              pile = keyboard.next();
              System.out.print("How many to remove: ");
              input = keyboard.nextInt();
  
              switch (pile) {
                  case "a": {
                      a = a - input;
                  }case "b": {
                      b = b - input;
                  }case "c": {
                      c = c - input;
                  }
  
              }
          }
      }
  }
  </code></pre>