Skip to content

Instantly share code, notes, and snippets.

@berdario
Created March 1, 2016 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berdario/0f2ebc4298176e416f8c to your computer and use it in GitHub Desktop.
Save berdario/0f2ebc4298176e416f8c to your computer and use it in GitHub Desktop.
groovy:000> trait A{ String duh() {"a"}}
===> true
groovy:000> trait B{ String duh() {"b"}}
===> true
groovy:000> class C implements A,B {}
===> true
groovy:000> c = new C()
===> C@797cf65c
groovy:000> def blez(A a){a.duh()+"!"}
===> true
groovy:000> blez(c)
===> b!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment