Advertisement
didito33

Person

Nov 21st, 2021
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. package file.example;
  2.  
  3. import java.io.Serializable;
  4.  
  5. public class Individual implements Serializable {
  6.  
  7. private String name;
  8. private int age;
  9.  
  10. public Individual(String name, int age) {
  11. this.name = name;
  12. this.age = age;
  13. }
  14.  
  15. public String getName() {
  16. return name;
  17. }
  18.  
  19. public void setName(String name) {
  20. this.name = name;
  21. }
  22.  
  23. public int getAge() {
  24. return age;
  25. }
  26.  
  27. public void setAge(int age) {
  28. this.age = age;
  29. }
  30. @Override
  31. public String toString() {
  32. return "Their{" + "name=" + name + '\'' + ", age" + age + "}";
  33. }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement