Java.next, Extension without inheritance, Part 1

See how Groovy, Scala, and Clojure bolt behavior onto classes

From the developerWorks archives

Neal Ford

Date archived: December 19, 2016 | First published: June 12, 2013

Groovy, Scala, and Clojure offer many extension mechanisms, whereas inheritance is virtually the Java™ language's only option. This installment looks at category classes, the ExpandoMetaClass, implicit casts, and protocols as ways to extend Java classes with the Java.next languages.

This content is no longer being updated or maintained. The full article is provided "as is" in a PDF file. Given the rapid evolution of technology, some steps and illustrations may have changed.



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Java development, Open source
ArticleID=933633
ArticleTitle=Java.next: Extension without inheritance, Part 1
publish-date=06122013