How do I check to see if there is space in an array?
<p>For part of schoolwork I need to write a <code>method</code> that goes through an array of objects to see if there is space to add another object to the <code>array</code>. If it was able to add an object then the <code>method</code> returns true and if it wasn't able to add it returns false. How do I check the <code>array</code> to see if there are empty cells in the array so I can add an element to the array? For example, I have an array that is size of 25 but only 15 cells are full and I want to add another object in one of the ten cells that are empty or <code>null</code>. This is essentially an add method with a <code>boolean</code> return value. But I need to know which cell I can add to and thus need to check which cell is empty or <code>null</code>.</p>