APPENDIX E MORE ON LISTS, MAPS, AND RANGES
The Groovy interpreter plays an important role when we invoke methods on an object declared in a Groovy script. Essentially, the interpreter intercepts these method calls so that it can add behaviors not present in the Java core classes. In this manner, Groovy designers have been able to extend the functionality of the Java core classes (the JDK) so that they are more Groovy-like. However, it is important to understand that the JDK itself is unchanged. For example, if we call the method each (see Chapter 9) on a List, as in:
then we should appreciate that no such method exists in any class in the JDK. ...
Get Groovy Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.