Last active
August 29, 2015 14:05
-
-
Save bloodredsun/8ad685ce40161a128557 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 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