title: Default case is being executed before even entering switch-case
body: <p>I run the program and it reaches while loop with input set on "" before the loop. When it enters the while loop it prints "Wrong input!" and then it asks to type in input = sc.nextLine(). Why? It hasn't even entered the switch-case statement.
  Thank you in advance.</p>
  
  <pre><code>        Scanner sc = new Scanner(System.in);
          int size;
          size = sc.nextInt();
          String[] mem = new String[size];
          int[] mem_index = new int[size];
          String input = "";
          while(!input.equals("quit")) {
          input = sc.nextLine();
  
          switch(input) {
              case "Z": mem = memAlloc(mem, allocRequest);
                        memPrint(mem, mem_index);
                        allocRequest++;
                        break;
              case "O": System.out.print("Type memory data id: ");
                        delRequest = sc.nextInt();
                        mem = memDel(mem, mem_index, delRequest);
                        memPrint(mem, mem_index);
                        break;
              case "F": mem = memFrag(mem, mem_index);
                        memPrint(mem, mem_index);
                        break;
              case "quit":    break;
              default:  System.out.println("Wrong input!");
                        break;
          }
      }
  </code></pre>