Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
package com.brs
object ScalaOverrideTraitExample extends App {
val myExample = new MyExample ;
myExample.writeOut();
}
trait BaseTrait {
def writeOut()
}
trait TraitOne extends BaseTrait {
override def writeOut() = {
println("In TraitOne")
}
}
trait TraitTwo extends BaseTrait {
override def writeOut() = {
println("In TraitTwo")
}
}
class MyExample extends TraitOne with TraitTwo{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment