Advertisement
kmahadev

class SalariedEmployee

Aug 15th, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. public class SalariedEmployee extends Employee {
  3.  
  4. private double weeklySalary;
  5.  
  6. public SalariedEmployee(String fn, String ln, String ssn, double ws ) {
  7. super(fn, ln, ssn);
  8. /*this.firstName = fn;
  9. this.lastName = ln;
  10. this.ssn = ssn;*/
  11. this.weeklySalary = ws;
  12.  
  13. }
  14.  
  15. @Override //Override annotation
  16. public String toString() {
  17. String output = super.toString();
  18. output += String.format("\nSalary is: $%f", weeklySalary);
  19. return output;
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement