Skip to content

Commit bd0a0d0

Browse files
authored
Merge pull request scala#2149 from alvinj/fix-java-person-class
Corrected the first Java Person class
2 parents 93ec412 + 3264a20 commit bd0a0d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_overviews/scala3-book/scala-for-java-devs.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,14 @@ equivalent to the Scala code that follows it.
132132
<br>&nbsp; public int age;
133133
<br>&nbsp; public Person(
134134
<br>&nbsp;&nbsp;&nbsp; String firstName,
135-
<br>&nbsp;&nbsp;&nbsp; String lastName, int age
135+
<br>&nbsp;&nbsp;&nbsp; String lastName,
136+
<br>&nbsp;&nbsp;&nbsp; int age
136137
<br>&nbsp; ) {
137138
<br>&nbsp;&nbsp;&nbsp; this.firstName = firstName;
138139
<br>&nbsp;&nbsp;&nbsp; this.lastName = lastName;
139140
<br>&nbsp;&nbsp;&nbsp; this.age = age;
140141
<br>&nbsp; }
141-
<br>&nbsp; override String toString() {
142+
<br>&nbsp; public String toString() {
142143
<br>&nbsp;&nbsp;&nbsp; return String.format("%s %s is %d years old.", firstName, lastName, age);
143144
<br>&nbsp; }
144145
<br>}</code>

0 commit comments

Comments
 (0)