title: Why is Java skipping my second condition in the while loop?
body: <p>Does anyone know why the first condition is being skipped by Java?</p>
  
  <pre><code>while((withdraw % 100) != 0 &amp;&amp; (withdraw &gt; startBalance))
  </code></pre>
  
  <p>Although I state that the withdrawal must be less than the <code>startBalance</code>, you can still type a number that is higher than the <code>startBalance</code> and the the <code>newBalance</code> will be negative.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>public static void main(String[] args) {
  
    Scanner input = new Scanner(System.in);
    int startBalance = 1000;
    System.out.println("Please enter how much you want to withdraw: ");
    int withdraw = input.nextInt();
  
    while((withdraw % 100) != 0 &amp;&amp; (withdraw &gt; startBalance)){
      System.out.println("Sorry, you can only withdraw a value multiple of 100 (we only have 100 SEK bills): ");
      withdraw = input.nextInt();
    }
  
    int newBalance = startBalance-withdraw;
    System.out.println("Thanks! Your new balance is: SEK " + newBalance);
  }
  </code></pre>