Created
May 16, 2013 23:13
-
-
Save behrangsa/5595848 to your computer and use it in GitHub Desktop.
Sub/Super/Delegate
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 Del { | |
def del() { println "Del.del" } | |
} | |
class Super { | |
def sup() { println "Super.sup" } | |
} | |
class Sub extends Super { | |
@Delegate Del del = new Del() | |
def sub() { println "Sub.sub" } | |
} | |
def sub = new Sub() | |
sub.del() | |
sub.sup() | |
sub.sub() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment