Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Traits > Traits with Concrete Implementations

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