Skip to content

Commit 04c2f2c

Browse files
authored
Aggregating Data: Remove constructor (later concept) (#108)
1 parent 9528e6a commit 04c2f2c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/standard_input_ii/aggregating_data.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ you can use a class.[^dto]
5555
class Person {
5656
String firstName;
5757
String lastName;
58-
59-
Person(String firstName, String lastName) {
60-
this.firstName = firstName;
61-
this.lastName = lastName;
62-
}
6358
}
6459
6560
Person askForName() {
@@ -87,7 +82,10 @@ Person askForName() {
8782
}
8883
} while (true);
8984
90-
return new Person(firstName, lastName);
85+
var person = new Person();
86+
person.firstName = firstName;
87+
person.lastName = lastName;
88+
return person;
9189
}
9290
9391
void main() {

0 commit comments

Comments
 (0)