I want to do something like this in Groovy:
List<MyObject> list1 = getAList();
How can I assign a list to other list in groovy without having to iterate through the list I want to assign?
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.
That will work as you have it (assuming
getAListreturns a List)…Or do you mean you want a new list containing the same elements as the list returned?
If that’s the case, you can do
Or