Skip to content

Instantly share code, notes, and snippets.

@bloodredsun
Last active August 29, 2015 14:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bloodredsun/8ad685ce40161a128557 to your computer and use it in GitHub Desktop.
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