Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class Person {
  2. private String name;
  3. private Place birthPlace;
  4.  
  5. public Person() {}
  6.  
  7. public setName(String name) {
  8. this.name = name;
  9. }
  10.  
  11. public setBirthPlace(Place birthPlace) {
  12. this.birthPlace = birthPlace;
  13. }
  14.  
  15. public String getName() {
  16. return name;
  17. }
  18.  
  19. public Place getBirthPlace() {
  20. return birthPlace;
  21. }
  22. }
  23.  
  24. public class Person {
  25. private final String name;
  26. private final Place birthPlace;
  27.  
  28. public Person(String name, Place birthPlace) {
  29. this.name = name;
  30. this.birthPlace = birthPlace;
  31. }
  32.  
  33. public String getName() {
  34. return name;
  35. }
  36.  
  37. public Place getBirthPlace() {
  38. return birthPlace;
  39. }
  40. }
  41.  
  42. public class Person {
  43. public final String name;
  44. public final Place birthPlace;
  45.  
  46. public Person(String name, Place birthPlace) {
  47. this.name = name;
  48. this.birthPlace = birthPlace;
  49. }
  50. }
  51.  
  52. public class Person {
  53. private final String name;
  54. private final Place birthPlace;
  55.  
  56. @ConstructorProperties({"name", "birthPlace"})
  57. public Person(String name, Place birthPlace) {
  58. this.name = name;
  59. this.birthPlace = birthPlace;
  60. }
  61.  
  62. public String getName() {
  63. return name;
  64. }
  65.  
  66. public Place getBirthPlace() {
  67. return birthPlace;
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement