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

CHAPTER 7 METHODS

A method is a name given to a segment of code that can be executed or called one or more times in a program. Methods may also be given parameters that act as input values to the method call. Each method call may use different actual parameters that determine the effect of the method when it is executed.

Methods in Groovy partition large programs into smaller manageable units, thus simplifying the programming task. Each method is responsible for a particular functionality required in the application. One method can call or execute any other method. Thus, a task represented by one method can be partitioned into subtasks realized by other submethods. Further, methods developed in one program may be incorporated into other programs, ...

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