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 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.