Image

Imagegrrlpower wrote in Imagejava_dev

arraycopy?

So I am working on something where I have to display a selection from a list.. it was suggested we pass an array of Item Objects to the client, then display them. So I have my method to get the array but I can't quite figure out how to display them on the client side... do I need an arraycopy or something?

The function to get the array is invent.findItemsByQuant(10) and I've tried to simply assign it to a new array on the client side, looked at System.arraycopy, but that doesn't seem to really meet my needs... I have the feeling I have to loop through the returned array to assign it to a new one... but how can I do that without assigning it locally? Methinks a for loop like

for (int k = 0, k < invent.findItembyQuant(10).length, k++)
	invent.findItembyQuant(10)[k].toString;


is not likely to work out the way I want.....