#scala #traits
traits may not have constructor parameters (also called class parameters)
If you want to change selection, open document below and click on "Move attachment"
Scala Traitsh each class must inherit from just one superclass, a class can mix in any number of traits.
Traits are used to define object types by specifying the signature of the supported methods. Scala also allows traits to be partially implemented but <span>traits may not have constructor parameters.
A trait definition looks just like a class definition except that it uses the keyword trait as follows:
trait Equal {
def isEqual(x: Any): Boolean
def isNotEqual(x: Any): Boolean = ! Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details