Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 8.8 Employee.java
- *
- * @author Hafara Firdausi/ 5115100043
- * @version 01
- */
- public class Employee
- {
- private String firstName;
- private String lastName;
- private Date birthDate;
- private Date hireDate;
- //constructor to initialize name, birth date and hire date
- public Employee (String first, String last, Date dateOfBirth, Date dateOfHire)
- {
- firstName=first;
- lastName=last;
- birthDate=dateOfBirth;
- hireDate=dateOfHire;
- } //end Employee constructor
- //convert Employee to String format
- public String toString()
- {
- return String.format("%s, %s Hired: %s Birthday: %s", lastName, firstName, hireDate, birthDate);
- } //end method toString
- } //end class Employee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement