CHAPTER 3Groovy Data Types and ControlStructures

Groovy data types can be categorized into simple data types and collective data types. Simple data types include strings, regular expressions (regexes), and numbers. Collective data types include lists, maps, and ranges. Groovy offers support for such data types at the language level, meaning that it offers native syntax for declaring and using special operators on them.

Groovy control structures can be categorized into conditional structures and looping structures. Conditional structures include the if statement, the ternary operator (?:), and the switch statement. Looping structures include while and for loops.

This chapter covers, by example, all of Groovy's supported data types and control ...

Get Groovy and Grails Recipes now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.