what are the different ways to create an Arraylist and Hashmap in groovy

Viewed 25822

I have created an ArrayList like the following:

def list = new ArrayList()

But the codenarc report it is warning like following.

ArrayList objects are better instantiated using the form "[] as ArrayList"

What are the better ways to instantiate the collections?

4 Answers
Related