Skip to content

Commit ae41b8a

Browse files
committed
correct one missed code tab.
1 parent 6fa21a5 commit ae41b8a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

_zh-cn/overviews/scala3-book/domain-modeling-tools.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,20 @@ val fred = Person("Fred", 29)
654654

655655
在基本用法中,trait 可以用作接口,仅定义将由其他类实现的抽象成员:
656656

657+
{% tabs traits_1 class=tabs-scala-version %}
658+
{% tab 'Scala 2' %}
659+
660+
```scala
661+
trait Employee {
662+
def id: Int
663+
def firstName: String
664+
def lastName: String
665+
}
666+
```
667+
668+
{% endtab %}
669+
{% tab 'Scala 3' %}
670+
657671
```scala
658672
trait Employee:
659673
def id: Int

0 commit comments

Comments
 (0)