Looping in groovy

This tutorial show you various looping way in Groovy. The Groovy has the native java looping supports as well has some additional stuff for looping. While loop in Groovy Groovy supports the java while loop, below is the example package com.java.connect.groovy class GroovyLoopExample { static void main(args){ def x = 0 def y = 6 […]

Continue reading


Map in groovy tutorial

This tutorial shows you various use of Map in Groovy. Groovy has native language supports for java.util.Map, In addition Groovy has some Special syntax for map literals, and additional common methods. In this page we shows some additional common method of Groovy Map. You can define an empty Map as def map = [:] and […]

Continue reading


How to iterate List inside another List in groovy

This example shows you how to iterate one list inside another list in Groovy. We will use the Clouser to multilevel iteration, Below is the example code. package com.java.connect.groovy class GroovyListEachExample { static void main(args){ def list1 = [‘Window’, ‘Linux’, ‘Mac’] def list2 = [ ‘java’, ‘C’, ‘C++’, ‘.Net’, ‘PHP’, ‘Testing’ ] list1.each {platform-> list2.each […]

Continue reading


Numbers in groovy tutorial

This tutorial shows you some basics use of numbers in Groovy. Java supports primitive types and object types for all numbers types of java. Java has the wrapper classes to allow conversion from primitives to object or object to primitive. Java 5+ has the autoboxing feature to hide the conversion. Groovy treats everything as an […]

Continue reading