Last active
August 29, 2015 14:05
-
-
Save bloodredsun/bead053b78ae9267ad77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.brs | |
object ScalaCleverOverrideTraitExample extends App { | |
val myExample = new MyExample with TraitOne with TraitTwo ; | |
myExample.writeOut(); | |
} | |
trait BaseTrait { | |
def writeOut() | |
} | |
trait TraitOne extends scala.BaseTrait { | |
override def writeOut() = { | |
println("In TraitOne") | |
} | |
} | |
trait TraitTwo extends scala.BaseTrait { | |
override def writeOut() = { | |
println("In TraitTwo") | |
} | |
} | |
class MyExample{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment