Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- public class Employee implements Comparable<Employee> {
- @Override
- public String toString() {
- return "Employee [name=" + name + ", salary=" + salary + "]";
- }
- private String name;
- private double salary;
- public Employee(String name, double salary) {
- this.name = name;
- this.salary = salary;
- }
- public void raiseSalary(double byPercent) {
- double raise = salary * byPercent / 100;
- salary += raise;
- }
- public final String getName() {
- return name;
- }
- public double getSalary() {
- return salary;
- }
- @Override
- public int compareTo(Employee o) {
- // TODO Auto-generated method stub
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement