Connecting Tech Pros Worldwide Help | Site Map

array to List

Newbie
 
Join Date: Aug 2007
Posts: 2
#1: Aug 16 '07
Help!!
I have a List of integers and an array of integers and I need to replace the contents of the List with the contents of the array. any advice.
Ganon11's Avatar
Moderator
 
Join Date: Oct 2006
Location: New York, United States of America
Posts: 3,428
#2: Aug 17 '07

re: array to List


Could you just create a new List using the array as an argument to initalize it, and then set the original list equal to the new list (i.e. origList = newList;)?
Lives Here
 
Join Date: Sep 2006
Posts: 12,070
#3: Aug 17 '07

re: array to List


Have a look at the Arrays.asList method.
Reply


Similar Java bytes