Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
pp:2026:scala:l03 [2026/03/12 12:44] ldaniel |
pp:2026:scala:l03 [2026/03/26 07:30] (current) ldaniel sealed la binaryTree |
||
|---|---|---|---|
| Line 95: | Line 95: | ||
| The binary tree type definition for Scala is given below. Please copy-paste this definition in your Main.scala file from your laboratory project, in order for printTree to work properly. Call print from the function main and click the "run" text above the definition of main to see the result in terminal. | The binary tree type definition for Scala is given below. Please copy-paste this definition in your Main.scala file from your laboratory project, in order for printTree to work properly. Call print from the function main and click the "run" text above the definition of main to see the result in terminal. | ||
| <code scala> | <code scala> | ||
| - | trait BinaryTree { | + | sealed trait BinaryTree { |
| override def toString: String = super.toString: String | override def toString: String = super.toString: String | ||
| } | } | ||