Apache Groovy: Combining the Best of Python and Java
opensource.net
opensource.net
Instead we get an entire article about getters and setters, which uses a Java example with pointless getters and setters that just directly read/write a variable.
> Groovy has syntactic support for maps using [] to get and set the value based on the variable within the square brackets
Why variable? Does that mean you can't use expressions for indexing?
System.err.println "Usage: groovy Groovy01.groovy input-file"
System.exit(0)
Why does only the second call need parentheses? String s
s = 42
Looks like Groovy is weakly typed? strParam != null && strParam.isInteger() ? Integer.parseInt(strParam) : 0
Doesn't Groovy already have if-else? Why also add `?:` ?> In the previous article, you learned that Groovy’s version of truth means you don’t need to test for not null
The previous article doesn't even mention the word truth.