Skip to content

Commit 5a15b47

Browse files
benluobishabosha
authored andcommitted
correct endtabs.
1 parent e80a3f9 commit 5a15b47

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

_overviews/scala3-book/domain-modeling-tools.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,15 @@ Classes can also extend traits and abstract classes, which we cover in dedicated
148148
As a quick look at a few other features, class constructor parameters can also have default values:
149149

150150
{% tabs default-values_1 class=tabs-scala-version %}
151-
{% tab 'Scala 2 and 3' for=default-values_1 %}
151+
{% tab 'Scala 2' for=default-values_1 %}
152+
```scala
153+
class Socket(val timeout: Int = 5_000, val linger: Int = 5_000) {
154+
override def toString = s"timeout: $timeout, linger: $linger"
155+
}
156+
```
157+
{% endtab %}
158+
159+
{% tab 'Scala 3' for=default-values_1 %}
152160
```scala
153161
class Socket(val timeout: Int = 5_000, val linger: Int = 5_000):
154162
override def toString = s"timeout: $timeout, linger: $linger"
@@ -559,6 +567,9 @@ trait Employee:
559567
def firstName: String
560568
def lastName: String
561569
```
570+
{% endtab %}
571+
{% endtabs %}
572+
562573
However, traits can also contain concrete members.
563574
For instance, the following trait defines two abstract members---`numLegs` and `walk()`---and also has a concrete implementation of a `stop()` method:
564575

0 commit comments

Comments
 (0)