title: Switch statement for some reason does not like case 8. Compiler is acting real weird
body: <p>Here is the code:</p>
  
  <pre><code>public static void main(String args[])
      {
          int i=0;
          int m=0;
          double scale;
          boolean exit;
          Shape[] s = new Shape[10];
          while(exit !=true)
          {
              System.out.print("\nChoose an option:\n"+
                      "1-Add a new circle\n"+
                      "2-Add a new rectangle\n"+
                      "3-Delete all shapes\n"+
                      "4-Scale all shapes\n"+
                      "5-Display perimeter of all shapes\n"+
                      "6-Display the area of all shapes\n"+
                      "7-Enter scale factor\n"+
                      "8-Exit program\n");
  
              Scanner input = new Scanner(System.in);
              m=input.nextInt();
  
  
              if(i&lt;=9)
              {
                  switch (m)
                  {
  
  
                   case 1: Circle c = new Circle(0);
                           s[i]=c;
                           i++;
                           break;
                   case 2: Rectangle r = new Rectangle(1,1);
                           s[i]=r;
                           i++;
                           break;
  
                   case 3: s=null;
                           i=0;
                           break;
                   case 4: for(i=0; i&lt;s.length; i++)
                           {
                               s[i].scaleShape();
                           }
                           break;
                   case 5: for(i=0; i&lt;s.length; i++)
                           {
                              if(s[i] != null)
                              {   
                                  System.out.println(s[i].getPerimeter());
                              }
                           }
                           break;
                   case 6: for(i=0; i&lt;s.length; i++)
                           {
                              if(s[i] != null)
                              {
                                  System.out.println(s[i].getArea());
                              }
                           }
                           break;
                   case 7: do
                           {
                              System.out.println("\nEnter scale factor");
                              scale=input.nextDouble();
                           }
                           while(scale&lt;0);
                           Shape.setScaleFactor(scale);
  
                           }
                           break;
  
                   case 8: System.out.println("Do you want to quit?");
                           break; //Nothing here since loop should terminate it.
  
  
  
                   //default: System.out.println("Number must be 1-8");
                           // break;
  
  
                } 
  
           }
       }
     }
  </code></pre>
  
  <h2>Oddly the compiler is giving me an error on case 8 saying:</h2>
  
  <blockquote>
    <p>Type mismatch can't convert from int to boolean.</p>
  </blockquote>
  
  <p>But Im not converting anything to boolean</p>
  
  <blockquote>
    <p>-syntax error on token "case" assert expected
    -syntax error on token :, ; expected</p>
  </blockquote>
  
  <p>But all the commands there have semi-colons</p>
  
  <blockquote>
    <p>expression must return a value</p>
  </blockquote>
  
  <p>Why is the compiler acting so funny? Normally errors like that are easy to find. What is going on?</p>