Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update content for /th/tour/traits page #3025

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix error after solving conflict
fResult committed Nov 1, 2024
commit e9a8f43c1221bcf9fae1151ba928aed4b9636790
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -233,6 +233,8 @@ GEM
mutex_m (0.2.0)
net-http (0.4.1)
uri
nokogiri (1.16.5-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.5-x64-mingw-ucrt)
@@ -285,6 +287,7 @@ GEM
zeitwerk (2.6.7)

PLATFORMS
aarch64-linux
arm64-darwin-22
arm64-darwin-23
x64-mingw-ucrt
10 changes: 2 additions & 8 deletions _th/tour/traits.md
Original file line number Diff line number Diff line change
@@ -9,6 +9,8 @@ language: th

next-page: tuples
previous-page: classes
topics: traits
prerequisite-knowledge: expressions, classes, generics, objects, companion-objects
---

Trait ใช้เพื่อแชร์ interface และ field ระหว่างคลาส โดยที่ trait จะคล้ายกับ interface ใน Java 8\
@@ -148,14 +150,6 @@ iterator.next() // returns 1

{% tab 'Scala 2' for=trait-pet-example %}

{% tabs trait-pet-example class=tabs-scala-version %}

{% tab 'Scala 2' for=trait-pet-example %}

{% tabs trait-pet-example class=tabs-scala-version %}

{% tab 'Scala 2' for=trait-pet-example %}

```scala mdoc
import scala.collection.mutable.ArrayBuffer