File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed
src/main/java/com/winterbe/java8/samples/lambda Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change 11package com .winterbe .java8 .samples .lambda ;
22
33/**
4- * @author Benjamin Winterberg
5- */
4+ * @author Benjamin Winterberg
5+ */
66public class Person {
7- public String firstName ;
8- public String lastName ;
7+ public String firstName ;
8+ public String lastName ;
99
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+ }
1128
12- public Person (String firstName , String lastName ) {
13- this .firstName = firstName ;
14- this .lastName = lastName ;
15- }
1629}
You can’t perform that action at this time.
0 commit comments