Adam Carlin
Adam Carlin

Reputation: 244

Dynamic Array equivalent

Is there any dynamic array type variable in grails? At the moment I am just reverting to java and using a Vector but I want to try and keep the code as close to grails as possible.

Upvotes: 0

Views: 76

Answers (1)

WeMakeSoftware
WeMakeSoftware

Reputation: 9162

Try something like this:

def dynamicArray = []
dynamicArray << anyObject

Technically if will not be an array, but a List of some sort, but it will give you a feel of array. More info is available in the javadocs here

Upvotes: 1

Related Questions