title: Java program doesn't have any output when using a switch statement inside a while loop?
body: <p>So I need the statements inside the while loop to repeat until the user enters 4 (which exits the program), but when I try to run the program, nothing is outputted to the screen (but it compiles just fine). Why would it do this? This answer is probably really simple, but any help would be really appreciated!</p>
  
  <pre><code>public class Driver 
  {
  public static void main(String[] args) 
  {
      Scanner keyboard = new Scanner(System.in);
      int answer;
      boolean bool = true;
  
      while(bool);
      {
          System.out.println("\n\tGeometry Calculator\n" + 
                              "\t1. Calculate the Area of a Circle\n" +
                              "\t2. Calculate the Area of a Rectangle\n" +
                              "\t3. Calculate the Area of a Triangle\n" +
                              "\t4. Quit\n");
          System.out.print("\tEnter your choice (1-4): ");
          answer = keyboard.nextInt();
  
          switch(answer)
          {
              case 1:
                  System.out.println("\n\tCalculating the area of a circle...");
                  break;
              case 2:
                  System.out.println("\n\tCalculating the area of a rectangle...");
                  break;
              case 3:
                  System.out.println("\n\tCalculating the area of a triangle...");
                  break;
              case 4:
                  System.out.println("\n\tQuiting...");
                  System.exit(0);
                  break;
              default:
                  System.out.println("\n\tPlease enter a number between 1 and 4.");
          }
  
          if(answer == 4)
              bool = false;
      }
  }
  </code></pre>