File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package com .zetcode ;
2+
3+ import java .time .LocalDate ;
4+
5+ class User {
6+
7+ private String name ;
8+ private String occupation ;
9+ private LocalDate born ;
10+
11+ public User (String name , String occupation , LocalDate born ) {
12+ this .name = name ;
13+ this .occupation = occupation ;
14+ this .born = born ;
15+ }
16+
17+ public String getName () {
18+ return name ;
19+ }
20+
21+ public void setName (String name ) {
22+ this .name = name ;
23+ }
24+
25+ public String getOccupation () {
26+ return occupation ;
27+ }
28+
29+ public void setOccupation (String occupation ) {
30+ this .occupation = occupation ;
31+ }
32+
33+ public LocalDate getBorn () {
34+ return born ;
35+ }
36+
37+ public void setBorn (LocalDate born ) {
38+ this .born = born ;
39+ }
40+
41+ @ Override
42+ public String toString () {
43+
44+ final var sb = new StringBuilder ("User{" );
45+ sb .append ("name='" ).append (name ).append ('\'' );
46+ sb .append (", occupation='" ).append (occupation ).append ('\'' );
47+ sb .append (", born=" ).append (born );
48+ sb .append ('}' );
49+ return sb .toString ();
50+ }
51+ }
You can’t perform that action at this time.
0 commit comments