开发者

Java One Array data to another Array

开发者 https://www.devze.com 2023-03-07 15:15 出处:网络
Basically I need f开发者_Go百科or example toarray1 in position 0..9 to contain items form another array from posinion 20..29. How do i do this? I tried playing with for loop but this way i can only ge

Basically I need f开发者_Go百科or example to array1 in position 0..9 to contain items form another array from posinion 20..29. How do i do this? I tried playing with for loop but this way i can only get data from the same positions in both arrays.


// copy indices 20-29 from array2 to indices 0-9 in array1
System.arraycopy(array2, 20, array1, 0, 10);
0

精彩评论

暂无评论...
验证码 换一张
取 消