| | |
JAVA: copying 1d array's value into a specific row of a 2d array
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
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.arraycopy if you don't want modifications in the original oneDArray to be reflected in twoDArray. Also read this. I don't accept change; I don't deserve to live.
•
•
Join Date: Dec 2008
Posts: 4
Reputation:
Solved Threads: 0
thnx for the valuable input...appreciate it..muah.
•
•
•
•
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 usetwoDArray[3] = oneDArray;orSystem.arraycopyif you don't want modifications in the original oneDArray to be reflected in twoDArray. Also read this.
![]() |
Other Threads in the Java Forum
- Previous Thread: IP blocking or MAC address blocking
- Next Thread: noclassdeffound error
| Thread Tools | Search this Thread |
android api applet application applications array arrays automation balls bank binary bluetooth business chat class classes clear client code codesnippet collections component database db defaultmethod development dice dragging draw ebook eclipse error event exception formatingtextintooltipjava fractal game givemetehcodez graphics gui hql html ide image infinite input integer invokingapacheantprogrammatically j2me java javaprojects jni jpanel julia linux list loop looping map method methods mobile mysql netbeans newbie numbers openjavafx oracle parameter php print problem program programming project recursion repositories scanner screen scrollbar server set size sms sort sorting sql sqlserver state storm string sun superclass swing swt text-file threads time tree windows






