File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Groovy and the fly likes create two-dimensional array in Groovy/grails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "create two-dimensional array in Groovy/grails" Watch "create two-dimensional array in Groovy/grails" New topic

create two-dimensional array in Groovy/grails

Doug Bell

Joined: Mar 06, 2012
Posts: 1
I am extreme newbie. I'd like to read in multiple lines and create a two-dimensional array from them. I am using Groovy/Grails with Intellij. Can you show me how to create/update a two-dimentsional character array?

Thanks so much!

Doug Bell
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3152

You can create a 2 dimensional array like this def twoDim = [[3,4,5,6],[1,2,4]]. Read more about it here

Mohamed Sanaulla | My Blog
I agree. Here's the link:
subject: create two-dimensional array in Groovy/grails
jQuery in Action, 3rd edition