title: Why does my Exception program keep running?
body: <p>I have a program, but the problem is it keeps running even after I tell it to stop. I have told it to stop running when the Boolean variable becomes false, but even after the variable becomes false, the program keeps running. The only way I found the program to keep running is when I take out the "=true" part in the while statement. So why do I need to take out the "=true" part in the statement for the program to function normally? </p>
  
  <pre><code>import java.util.Scanner;
  
  public class EvenOdd {
  
      public static void main(String[] args) {
          Scanner input=new Scanner(System.in);
          int num;
          boolean continueLoop=true;
          do {
              try {
                  System.out.println("Enter an even number");
                  num=input.nextInt();
                  if(num%2==0)
                   System.out.println("That is an even number");
                  else
                   throw new IllegalArgumentException();
                  continueLoop=false;
              }
              catch(IllegalArgumentException ae) {
                  System.err.println(ae+"\nThat is a odd number");
              }
          } while(continueLoop=true);
          input.close();
      }
  
  }
  </code></pre>