Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public class Employee {
  2. private String code;
  3. private String dept;
  4. private String name;
  5. private int age;
  6.  
  7. public Employee(){
  8. this.code="";
  9. this.dept="";
  10. this.name="";
  11. this.age=0;
  12. }
  13.  
  14. public Employee(String code, String dept, String name, int age) {
  15. this.code = code;
  16. this.dept = dept;
  17. this.name = name;
  18. this.age = age;
  19. }
  20.  
  21. public String getCode() {
  22. return code;
  23. }
  24. public void setCode(String code) {
  25. this.code = code;
  26. }
  27. public String getDept() {
  28. return dept;
  29. }
  30. public void setDept(String dept) {
  31. this.dept = dept;
  32. }
  33. public String getName() {
  34. return name;
  35. }
  36. public void setName(String name) {
  37. this.name = name;
  38. }
  39. public int getAge() {
  40. return age;
  41. }
  42. public void setAge(int age) {
  43. this.age = age;
  44. }
  45.  
  46. @Override
  47. public String toString() {
  48. return "Employee [code=" + code + ", dept=" + dept + ", name=" + name + ", age=" + age + "]";
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement