Created
August 10, 2013 21:55
-
-
Save akkerman/6202345 to your computer and use it in GitHub Desktop.
This file contains 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
class Voertuig(val naam:String, var snelheid:Int = 0) { } | |
trait Auto extends Voertuig { | |
def rijden() { | |
println( "Ik rij in mijn " + naam) | |
} | |
} | |
trait Boot extends Voertuig { | |
def varen() { | |
println( "Ik vaar in mijn " + naam ) | |
} | |
} | |
trait Amfibie extends Voertuig with Auto with Boot { } | |
val a = new Voertuig("Hovercraft", 120) with Amfibie | |
println(a.naam) | |
a.varen | |
a.rijden |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment