![]() |
| ||
| JAVA: copying 1d array's value into a specific row of a 2d array Hi, I need some enlightenment with copying arrays in JAVA from some of ya seasoned lots. I have this 2d array , twoDarray[10][6] and another 1d array oneDarray[1,2,3,4,5,6]. I'd like to copy the 1d array into the 4th row of the 2d array.Suggestion please. Thnx in advance. |
| ||
| Re: JAVA: copying 1d array's value into a specific row of a 2d array The twoDArray in your case is just an array of size 10 with each slot referring to a integer array i.e. two dimensional arrays in Java are just an array of arrays. Hence you can either use twoDArray[3] = oneDArray;or System.arraycopyif you don't want modifications in the original oneDArray to be reflected in twoDArray. Also read this. |
| ||
| Re: JAVA: copying 1d array's value into a specific row of a 2d array thnx for the valuable input...appreciate it..muah. Quote:
|
| All times are GMT -4. The time now is 12:23 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC