Advertisement
kmahadev

class Employee

Aug 15th, 2012
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1.  
  2. public class Employee {
  3. protected String firstName;
  4. protected String lastName;
  5. protected String ssn;
  6.  
  7. public Employee() {
  8. this.firstName = "";
  9. this.lastName = "";
  10. this.ssn = "";
  11. }
  12.  
  13. public Employee(String fn, String ln, String ssn) {
  14. this.firstName = fn;
  15. this.lastName = ln;
  16. this.ssn = ssn;
  17. }
  18.  
  19. public String toString() {
  20. return String.format("Employee Info is: %s %s whose SSN is: %s", firstName, lastName, ssn);
  21. }
  22.  
  23. /**
  24. * @return the firstName
  25. */
  26. public String getFirstName() {
  27. return firstName;
  28. }
  29.  
  30. /**
  31. * @param firstName the firstName to set
  32. */
  33. public void setFirstName(String firstName) {
  34. this.firstName = firstName;
  35. }
  36.  
  37. /**
  38. * @return the lastName
  39. */
  40. public String getLastName() {
  41. return lastName;
  42. }
  43.  
  44. /**
  45. * @param lastName the lastName to set
  46. */
  47. public void setLastName(String lastName) {
  48. this.lastName = lastName;
  49. }
  50.  
  51. /**
  52. * @return the ssn
  53. */
  54. public String getSsn() {
  55. return ssn;
  56. }
  57.  
  58. /**
  59. * @param ssn the ssn to set
  60. */
  61. public void setSsn(String ssn) {
  62. this.ssn = ssn;
  63. }
  64.  
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement