Hey all,
I am tasked with not using any array methods aside from .length, and not to use ArrayList. Essentially, I am trying to add another int to the end of the array. If the array has a spot (i.e, a 0), it replaces that spot. If there is no free spots (i.e, no 0's) we double the size of the array, add the number, and return the same array. here's what I have:
and my GetCurrentSize code:
I think my issue lies with properly copying the temporary array to the permanent array (list). Any insight?
I am tasked with not using any array methods aside from .length, and not to use ArrayList. Essentially, I am trying to add another int to the end of the array. If the array has a spot (i.e, a 0), it replaces that spot. If there is no free spots (i.e, no 0's) we double the size of the array, add the number, and return the same array. here's what I have:
and my GetCurrentSize code:
I think my issue lies with properly copying the temporary array to the permanent array (list). Any insight?