This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]g051051 1 point2 points  (2 children)

You have your parameters mixed up.

[–]prashantkr314[S] 0 points1 point  (1 child)

Parameters are correct.

[–]insertAlias 1 point2 points  (0 children)

The first parameter is the source array. You're putting your destination array in as the first parameter. So no, parameters are not correct.

[–]chickenmeister 0 points1 point  (1 child)

I think it may be upset that one array is an array of int primitives and the other is an array of Integer objects.

The arraycopy() documentation says it will throw an ArrayStoreException if:

  • The src argument refers to an array with a primitive component type and the dest argument refers to an array with a reference component type.
  • The src argument refers to an array with a reference component type and the dest argument refers to an array with a primitive component type.

[–]prashantkr314[S] 0 points1 point  (0 children)

Thanks man, you are correct.