Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Identifier expected error

807598May 7 2006 — edited May 7 2006
Hello,

I am having an issue with an identifier error. I originally wrote the following code for a beginning java class at my University and it worked without any problem. The issue is when I try to compile it on my laptop at home, i get the identifier error at the list declaration and the public List<Duty> method . I suppose i could be using a newer version of the JRE but I have no way of checking at the moment. Any ideas on what is wrong here?
import java.util.*;

public abstract class Employee
{
	protected String 	 employeeName;
	protected char   	 status;
	protected int    	 employeeID;
	protected List<Duty> dutyList = new ArrayList<Duty>();
	private static int   key = 0;


	public Employee(String employeeName, char status)
	{
		this.employeeName = employeeName;
		this.status = status;
		employeeID = key++;
	}

	public int getEmployeeID()
	{
		return employeeID;
	}

	public String getEmployeeName()
	{
		return employeeName;
	}

	public char getEmployeeStatus()
	{
		return status;
	}

	public void addDuty(Duty duty)
	{
		dutyList.add(duty);
	}

	public List<Duty> getDutyList()
	{
		return dutyList;
	}

	public abstract int getVacationDays();

	public abstract double getHourlyWage();
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 4 2006
Added on May 7 2006
2 comments
78 views