0

Basically I need for 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.

2
  • Can you please post your for loop? Thanks. Commented May 20, 2011 at 19:19
  • You need to give more detail about what you are trying to do and post the code you are trying to use to accomplish the task. Commented May 20, 2011 at 19:21

1 Answer 1

7
// copy indices 20-29 from array2 to indices 0-9 in array1
System.arraycopy(array2, 20, array1, 0, 10);
Sign up to request clarification or add additional context in comments.

1 Comment

oh, i think I need to read documentation more often, didn't even knew about this method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.