SHARE
TWEET

Untitled

a guest Jul 18th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main;
  2.  
  3. public class Employee implements Comparable<Employee> {
  4.    
  5.         @Override
  6.         public String toString() {
  7.             return "Employee [name=" + name + ", salary=" + salary + "]";
  8.         }
  9.  
  10.         private String name;
  11.         private double salary;
  12.            
  13.         public Employee(String name, double salary) {
  14.             this.name = name;
  15.             this.salary = salary;
  16.         }
  17.  
  18.         public void raiseSalary(double byPercent) {
  19.             double raise = salary * byPercent / 100;
  20.             salary += raise;    
  21.         }
  22.        
  23.         public final String getName() {
  24.             return name;
  25.         }
  26.        
  27.         public double getSalary() {
  28.             return salary;
  29.         }
  30.  
  31.         @Override
  32.         public int compareTo(Employee o) {
  33.             // TODO Auto-generated method stub
  34.             return 0;
  35.         }
  36.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top