Created
November 3, 2011 15:46
-
-
Save notyy/1336825 to your computer and use it in GitHub Desktop.
multi inheri
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
trait Wood { | |
def burn = println("I am burning") | |
} | |
trait Door { | |
def open = println("opened, you can coming") | |
} | |
class WoodDoor extends Door with Wood | |
scala> val woodDoor = new WoodDoor | |
woodDoor: WoodDoor = WoodDoor@7224eaaa | |
scala> woodDoor.open | |
opened, you can coming | |
scala> woodDoor.burn | |
I am burning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment