File tree 1 file changed +22
-9
lines changed
src/main/java/com/winterbe/java8/samples/lambda 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change 1
1
package com .winterbe .java8 .samples .lambda ;
2
2
3
3
/**
4
- * @author Benjamin Winterberg
5
- */
4
+ * @author Benjamin Winterberg
5
+ */
6
6
public class Person {
7
- public String firstName ;
8
- public String lastName ;
7
+ public String firstName ;
8
+ public String lastName ;
9
9
10
- public Person () {}
10
+ public Person () {
11
+ }
12
+
13
+ public Person (String firstName , String lastName ) {
14
+ this .firstName = firstName ;
15
+ this .lastName = lastName ;
16
+ }
17
+
18
+ @ Override
19
+ public String toString () {
20
+ StringBuilder builder = new StringBuilder ();
21
+ builder .append ("Person [firstName=" );
22
+ builder .append (firstName );
23
+ builder .append (", lastName=" );
24
+ builder .append (lastName );
25
+ builder .append ("]" );
26
+ return builder .toString ();
27
+ }
11
28
12
- public Person (String firstName , String lastName ) {
13
- this .firstName = firstName ;
14
- this .lastName = lastName ;
15
- }
16
29
}
You can’t perform that action at this time.
0 commit comments