While any of the Java examples works in Groovy, too, you can also use string interpolation like shown here.
String interpolation ("$i") gives you a GString, which in many places can be used as a string because it is a CharSequence. Here, for clarity, the GString is converted to a String using the toString() method.
Perl automatically converts numbers to strings, and strings to numbers, whenever required. The concatenation with the empty string is superfluous, it only indicates programmer intent.