Search code examples
javaimportjgrasp

Illegal start of type on import?


Hey so I am getting an illegal start of type on my import statements and i can't figure out why. I'm using jGRASP and have the newest jdk and jre installed.

import java.util.*;
import java.io.*;

public class SalaryCalc
{
   private double tips;
   private double hours;

   private double wage;
   private String day;
   private int[] date;

import java.util.Scanner;
import java.io.*;

   /*public static void SalaryCalc(double t, double h, double w, double d, int[] da);
   {
      tips=t;
      hours=h;
      wage=w;
      day=d;
      date= new int[3];
      for(int i=0;i<3;i++)
         date[i]=da[i];
   }

   public double hourly()
   {
      double hour=0;
      hour=tips;
      hour+=wage;
      hour=hour/hours;
      return hour;
   }*/

   public static void main(String[] args)
   {
      File f = new File("SaveFile");
      Scanner sc = new Scanner(f);
         while(sc.hasNextLine)
         {
            sc.nextLine();
         }
      System.out.println(sc.nextLine());
   }
}

any ideas what I'm doing wrong? Thanks


Solution

  • You have imports in the middle of your class. Move them above.