How check if array is full and if not full add to it?
问题 I've got array. I've got an isFull method, which checks if the array is full, but I don't know how to use this to check if it's full, then if it's not full add to the array, otherwise disregard the add call. The array should take 10 elements and then not accept any more. After 10 elements, it should 'be full' and disregard any addSpy calls. How would you implement this? public class ConcreteSubject extends AbstractSubject { public int arySize; private int i = 0; private static AbstractSpy[]