I have two arrays, and I am trying to copy the array values from one to the other, but not all of them. Here is the code that I have. I am getting an error on the line with finalplace[y] = place[y];. I have another array called place, which is the longer array. I do not want to make an exact copy of the place array. I just want to get the first array values where their placement is less than count. Any ideas?
int [] finalplace = new int [count];
for (int y = 0; y <= count; y = y + 1) {
finalplace[y] = place[y];
}