title: I am a beginner and want to try the loop because I failed to try it in java
body: <p>I tried add the loop in my switch case, in the IDE there is no problem code, but when it runs why does it always appear &quot;java: reach end of file when parsing&quot; wrong where is my loop?</p>
  <pre class="lang-java prettyprint-override"><code>import java.util.Scanner;
  /*
   * To change this license header, choose License Headers in Project Properties.
   * To change this template file, choose Tools | Templates
   * and open the template in the editor.
   */
  
  /**
   * @author AZ
   **/
  
  public class Karyawan {
      
      public Karyawan() {
      }
      
      public void hitungGaji(){
      }
      
      public static void main(String[] args) {
          int menu, hari;
  
          Scanner input = new Scanner(System.in);
  
          while(input.hasNextInt()){
  
          System.out.println(&quot;Kalkulasi Gaji&quot;);
          System.out.println(&quot;1. Staff&quot;);
          System.out.println(&quot;2. Manager&quot;);
          System.out.println(&quot;3. Direktur&quot;);
          System.out.println(&quot;Pilihan Menu : &quot;);
          menu = input.nextInt();
  
  
              switch (menu){
                  case 0:
                      break;
                  case 1:
                      System.out.println(&quot;Masukan Hari : &quot;);
                      hari = input.nextInt();
  
                      Karyawan staff = new Staff(30, hari);
                      staff.hitungGaji();
                      break;
                  case 2:
                      System.out.println(&quot;Masukan Hari : &quot;);
                      hari = input.nextInt();
  
                      Karyawan manager = new Manager(50, 10, hari);
                      manager.hitungGaji();
                      break;
                  case 3:
                      System.out.println(&quot;Masukan Hari : &quot;);
                      hari = input.nextInt();
  
                      Karyawan direktur = new Direktur(75, 20, 300, hari);
                      direktur.hitungGaji();
                      break;
  
                  default:
                      System.out.println(&quot;Pilih menu yang sesuai&quot;);
  
              }
  
          }
      }
  </code></pre>