Skip to content

Instantly share code, notes, and snippets.

@rjhall
Created August 1, 2013 20:12
Show Gist options
  • Save rjhall/6134808 to your computer and use it in GitHub Desktop.
Save rjhall/6134808 to your computer and use it in GitHub Desktop.
pwn.scala
scala> abstract class A { def holler : String; println(holler) }
defined class A
scala> class B extends A { def holler = "holler" }
defined class B
scala> new B()
holler
res0: B = B@54011d95
scala> class C extends A { val pwn = "thanks odersky"; def holler = pwn }
defined class C
scala> new C()
null
res1: C = C@27e3bfb6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment