Skip to content

Instantly share code, notes, and snippets.

@akkerman
Created August 10, 2013 21:55
Show Gist options
  • Save akkerman/6202345 to your computer and use it in GitHub Desktop.
Save akkerman/6202345 to your computer and use it in GitHub Desktop.
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