FileDocCategorySizeDatePackage
Employee.javaAPI DocExample470Tue Jun 03 21:44:56 BST 2003None

Employee.java

public class Employee extends Person {
	private short deptCode;
	private int staffNumber;

	public Employee(String firstName, String lastName, short dept, int number) {
		super(firstName, lastName);
		setDeptCode(dept);
		setStaffID(number);
	}

	public void setDeptCode(short dept) {
		deptCode = dept;
	}

	public void setStaffID(int number) {
		if (number < 1)
			throw new IllegalArgumentException("Invalid staff number " +
				number);
		staffNumber = number;
	}
}