Blog
Memoization in Groovy
18 Jan, 15

Memoization in Groovy

Hi Guys! I would like to share with you a very interesting concept of groovy that I learnt in the Grails Conference I attended last week. The concept is “Memoization in Groovy”. I didn’t hear about Memoization before. I found it quite interesting....
Groovy list: Get element from last
11 Dec, 14

Groovy list: Get element from last

Groovy has lots of awesome features which helps a lot in every day development, thanks @groovy. This blog demonstrate a cool feature of groovy list. Get element from last in a groovy list Lets have a list List list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] We can easily get...
Fetch most starred repository from github
13 Oct, 14

Fetch most starred repository from github

Last week I worked a task to print most starred repositories and its last commit message. I want to share my experience with you. To achieve this I implemented an API named jcabi-github. Its an Object Oriented Github API which provide a solution to use github API in...
Initialize groovy list with default value
17 Sep, 14

Initialize groovy list with default value

Hello friends ,In this blog we learn how to create a groovy list with default value. We can create and use withDefault() method to define the value of elements not yet in the list. We use a closure as a argument to this method which returns the default value. We can...
Assign List Entries To Multiple Variables
10 Sep, 14

Assign List Entries To Multiple Variables

One of the Groovy’s sexy feature is that we can assign list entries to multiple variables. One of the scenario I faced that my method returns a list and I have to assign that list entries to different variables As: def myMethod(){ ['Abdullah', 'Mohd'] } def...
Loops In Groovy
1 Sep, 14

Loops In Groovy

There are several types of loops in groovy. Following are some of the ways: List list = [4, 2, 9, 6, 7, 8, 2] for loop: for (int i = 0; i < list.size(); i++) { print list.get(i) } output = 4296782 for (int i : list) { print i } output = 4296782 for (int i...