public int max() { int max = elementData[0]; for (int i = 1; i < size; i++) { if (elementData[i] > max) { max = elementData[i]; } } return max; }