Click here to Skip to main content
15,938,848 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have an array list and I need to copy it to 2D array because it it easier to deal with
Posted
Comments
Sergey Alexandrovich Kryukov 16-Mar-15 11:08am    
Then just copy it. What's the problem?
—SA
phil.o 16-Mar-15 19:47pm    
What have you tried?

1 solution

As those are different types, you have to copy the elements one by one. The target array should be initialized with required dimensions before you copy the elements, such as in
Java
int[][] myArray = new int[columns][rows];


—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900