update,
This commit is contained in:
17
_resources/it114105/itp3914/Lab12/Ex2/Employee.java
Normal file
17
_resources/it114105/itp3914/Lab12/Ex2/Employee.java
Normal file
@@ -0,0 +1,17 @@
|
||||
public class Employee {
|
||||
public static final int MIN_ID = 1000;
|
||||
protected String name;
|
||||
protected int employeeID;
|
||||
|
||||
public Employee(String n, int id) {
|
||||
name = n;
|
||||
if (id < MIN_ID)
|
||||
employeeID = 0;
|
||||
else
|
||||
employeeID = id;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "Name: " + name + ", ID: " + employeeID;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user