title: Java - While Loop Conditional Statement Failure With int Values
body: <p>In Java programming, I'm trying to put an int through a while loop, and I want the int to be less than nine and greater than zero. But when the program runs, it only registers the first condition (in this case, "num&lt;1") and ignores the second ("num>9"). </p>
  
  <pre><code>int num = console.nextInt();
  while(num&lt;1 &amp;&amp; num&gt;9){
      System.out.println("You must type a number less than nine and greater than zero to continue.");
      num = console.nextInt();
  }
  </code></pre>
  
  <p>I've flipped their order, and the same issue shows up. Why is the program registering the first condition in the while loop but not the second? I've never had this problem with Strings, are ints formatted differently in this situation?</p>