...

/

Closures and Switch Statements

Closures and Switch Statements

Learn about closures and switch statements in Groovy.

Closures

A closure is a block of code in Groovy, which may or may not take parameters and return a value. It is very similar to lambda expressions in Java 8. For example, in the above code it.size() <= 4 and println it are closures.

Groovy closures have several implicit variables: ...

Access this course and 1400+ top-rated courses and projects.