10.3. Traits with Concrete Implementations
In Scala, the methods of a trait need not be abstract. For example, we can make our ConsoleLogger into a trait:
trait ConsoleLogger {
def log(msg: String) { println(msg) }
}
You are currently reading a PREVIEW of this book.
Get instant access to over
$1 million worth of books and videos.
Start a Free Trial