Groovy: what’s the purpose of “def” in “def x = 0”?
In the following piece of code (taken from the Groovy Semantics Manual page), why prefix the assignment with the keyword def? def x = 0 def y = 5 while ( y– > 0 ) { println “” + x + ” ” + y x++ } assert x == 5 The def keyword can … Read more