Skip to content

Commit 4e874a0

Browse files
author
exoego
committed
Apply changes in scala#1500 to Japanese translation
1 parent 933be1b commit 4e874a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

_ja/tutorials/scala-for-java-programmers.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ Scalaでは、スーパークラスから継承されたメソッドをオーバ
262262
"" + re + (if (im < 0) "-" else "+") + im + "i"
263263
}
264264

265+
オーバーライドされた `toString` は以下のように呼び出せます。
266+
267+
object ComplexNumbers {
268+
def main(args: Array[String]): Unit = {
269+
val c = new Complex(1.2, 3.4)
270+
println("Overridden toString(): " + c.toString)
271+
}
272+
}
265273

266274
## ケースクラスとパターンマッチ
267275

0 commit comments

Comments
 (0)