title: Seeking advice for case switch in loops. my description is below
body: <p>How do I make my output for Binary to Decimal this: Choice: 1 Binary Number : 2222 INVALID Binary Number</p>
  
  <p>If a user types the binary above 1.</p>
  
  <p>Also, how should I make the default of the switch case not show unless the user inputs the wrong option. Example: They input "HOOPdoop" which is not on the menu screen, the default will output saying that they must try again with the correct input. However, I don't want the default to output when the user inputs "Octal to Decimal" / after the calculation. </p>
  
  <p>here is my code: </p>
  
  <pre><code>    /**
       * @param args the command line arguments
       */
      public static void main(String[] args) {
          //VARIABLES BEFOR LOOP / FOR LOOP
          boolean Loop = true;
          String Choice;
          //OBJECTS
          Scanner input = new Scanner(System.in);
          while (Loop == true) {
              //MENU
              System.out.println("This program will convert...\n" + " \n" + "Binary to Decimal\n" + "Octal to Decimal\n" + "Decimal to Binary\n" + "Decimal to Octal\n" + "or you may Exit");
              //ASK
              System.out.println("--------------------------------------------");
              System.out.println("Which converter would you like to use? or would you like to exit? : ");
              Choice = input.nextLine();
              //VARIABLES INSIDE LOOP
              String binary = "";
              int decimal;
              String octal;
              switch (Choice) {
                  case "Binary to Decimal":
                      System.out.print("Enter a binary number: ");
                      binary = input.nextLine();
                      if (binary.equals(2)) {
                          System.out.println("INVALID.");
                      } else {
                          System.out.println("Decimal: " + Integer.parseInt(binary, 2));
                          System.out.println("-----------------------------------------");
                      }
                      break;
                  case "Decimal to Binary":
                      System.out.print("Enter decimal number: ");
                      decimal = input.nextInt();
                      int answer = decimal;
                      while (answer &gt; 0) {
                          binary = (answer % 2) + binary;
                          answer = answer / 2;
                      }
                      System.out.println("The binary number = " + binary);
                      System.out.println("-----------------------------------------");
                      break;
                  case "Decimal to Octal":
                      System.out.print("Enter decimal number: ");
                      decimal = input.nextInt();
                      octal = Integer.toOctalString(decimal);
                      System.out.println("Octal number = " + octal);
                      System.out.println("-----------------------------------------");
                      break;
                  case "Octal to Decimal":
                      System.out.print("Enter a Octal number: ");
                      octal = input.nextLine();
                      System.out.println("Decimal: " + Integer.parseInt(octal, 8));
                      System.out.println("-----------------------------------------");
                      break;
                  case "Exit":
                      System.out.println("Goodbye!!");
                      Loop = false;
                      break;
              }
          }
      }
  }``` 
  </code></pre>