Is there a short way to create a collection/array in size N with each cell initialized to zero in Groovy? Can’t seem to find it on http://groovy.codehaus.org/JN1015-Collections
For example
arr = func(3)
would result in
arr = [0, 0, 0]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yep, the
Collection#multiply(or*) method: