Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Employee {
- private String firstName, lastName;
- private boolean isPaid;
- private int hours;
- public Employee(String firstName, String lastName, boolean isPaid, int hours) {
- this.firstName = firstName;
- this.lastName = lastName;
- this.isPaid = isPaid;
- this.hours = Math.max(hours, 0);
- }
- public String getFirstName() {
- return firstName;
- }
- public void setFirstName(String firstNam) {
- this.firstName = firstNam;
- }
- public String getLastName() {
- return lastName;
- }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- public boolean isPaid() {
- return isPaid;
- }
- public int getHours() {
- return hours;
- }
- public void setHours(int hours) {
- this.hours = hours;
- }
- @Override
- public String toString() {
- return "Employee{" +
- "firstNam='" + firstName + '\'' +
- ", lastName='" + lastName + '\'' +
- ", isPaid=" + isPaid +
- ", hours=" + hours +
- '}';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement