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

后端 未结 4 1616
逝去的感伤
逝去的感伤 2021-01-05 02:53

I have created an ArrayList like the following:

def list = new ArrayList()

But the codenarc report it is warning like following.

         


        
4条回答
  •  一生所求
    2021-01-05 03:24

    Why don't you just use a suggestion from codenarc?

    def list = [] as ArrayList
    

提交回复
热议问题