Translate

Tuesday 5 October 2021

Clousers in Groovy Scripting groovy training telugu 23

 Watch This Video

https://youtu.be/-bDzR88icQw

--------------------------------------------------------------------------------------------------------------------------
http://groovy-lang.org/closures.html



Closures:


This chapter covers Groovy Closures. A closure in Groovy is an open,
anonymous, block of code that can take arguments, return a value 
and be assigned to a variable. A closure may reference variables 
declared in its surrounding scope. In opposition to the formal 
definition of a closure, Closure in the Groovy language can also 
contain free variables which are defined outside of its surrounding scope.
While breaking the formal concept of a closure, it offers a variety of 
advantages which are described in this chapter.


Syntax:

{ [closureParameters -> ] statements }






No comments:

Post a Comment

Note: only a member of this blog may post a comment.