There is no method append() on arrays. Instead as already suggested a List object can service the need for dynamically inserting elements eg. ... <看更多>
Is this really needed? int[] newArray = (int[]) Array.newInstance(oldArray.getClass().getComponentType(), len + 1);. I would do something like: ... <看更多>