O'Reilly logo

Groovy Programming by John Savage, Kenneth Barclay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX C MORE ON NUMBERS AND EXPRESSIONS

The Groovy interpreter plays an important role in the evaluation of an expression. For example, in Chapter 2, we discussed operators in the context of the evaluation expressions such as 123 + 456. The assumption made was that it was possible to send the message plus to an Integer object. This is not strictly true because there is no class in the Groovy environment with that method. The Groovy interpreter recognizes that two integers are being added and arranges matters so that it appears that the method call 123.plus (456) is executed. The attraction of this approach is that the core Java classes such as Integer, on which Groovy is built, are unchanged, yet they give us a more Groovy-like functionality. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required