June 2015
Intermediate to advanced
912 pages
26h 56m
English
This appendix covers
Cheat sheets provide you with quick information and examples to get you up and running quickly. For more details about any topic, refer to the corresponding section in the book or the Groovy documentation.
For more information, see chapter 3.
// normal use def g1 = "1 + 1 equals ${1 + 1}" assert g1 == '1 + 1 equals 2' assert g1 instanceof CharSequence assert g1 instanceof GString def x = 10 def g2 = "$x" // reference assert g2 == "10" def g3 = "${x}" // expression assert g3 == "10" // lazy evaluation with a writeable closure! def g4 = "${ -> x}" // closure x = 20 // value change after definition ...Read now
Unlock full access