The length of an array is immutable in java. This means you can't change the size of an array once you have created it. If you initialised it with 2 elements, its length is 2. You can however use a different collection.
List myList = new ArrayList();
myList.add(5);
myList.add(7);
And with a wrapper method
public void addMember(Integer x) {
myList.add(x);
};