I am writing a program for school. I have finished most of it but I keep getting an error unexpected type: required value found class right after my scanner object. It look correct to me but I keep getting this error. Any help would be appreciated.
/**
*
* @author Randy
*/
import java.util.Scanner;//Import scanner
public class RandyGilmanhw2a {
static int year_of_birth;
static int age;
public RandyGilmanhw2a (){//begin constructor
year_of_birth = 1900;
age = 0;
}//end constructor
public int getYear(){//get year method
return year_of_birth;
}//end method
public int getAge(int year_of_birth){//get year method
age = 2014 - year_of_birth;
return age;
}//end get year method
public void setYear (int year){//set year method
this.year_of_birth = year;
}//end method
public static void main(String[] args) {//begin main
RandyGilmanhw2a user1 = new RandyGilmanhw2a();
Scanner year = new Scanner(System.in);//create a scanner object
System.out.println("Please enter the year you were born: ");
int year_of_birth = int year.nextInt();
while( year_of_birth < 1900 || year_of_birth > 2014 ) {//begin while loop
System.out.print("Please reenter the year you were born." );
System.out.print("You must have an integer between 1900 and 2014:" );
System.out.print("\n");
}//end while
user1.getAge(year_of_birth);
System.out.print("You are " + age + "years old." );
}//end main
}//end class
Specifically, it is at this code.
int year_of_birth = int year.nextInt();
Thanks