public class SortedNumberList extends NumberList // extend NumberList so that values are in sorted order - this requires modifying add, we can also make find more efficient { // no new instance data public SortedNumberList() // call no-arg constructor of SortedNumberList since no change to instance data { super(); } public SortedNumberList(int size) // call 1-arg constructor { super(size); } @Override public int find(int x) // this find is more efficient because if we find a value list[i] > x then we know x is not in the list and we can return -1 at that point { for(int i=0;list[i]=i;j--) // shift all elements from i up 1 position list[j+1]=list[j]; list[i]=x; // place x in vacated spot number++; } } }