Now write a class SortedIntList that extends IntList. SortedIntList should be just like IntList except that its elements should always be sorted. This means that when an element is inserted into a SortedIntList, it should be put into its sorted place, not just at the end of the array. Think carefully about what methods and instance variables you have to define in SortedIntList and what you can inherit directly from IntList -- don't override anything you don't have to.
HINT: to get this to work, SortedIntList needs to override exactly one method it inherits from IntList. You shouldn't need to add any new methods other than, perhaps, constructors.
To test your class, modify ListTest.java so that after it creates and prints an IntList, it creates and prints a SortedIntList containing the same elements. Naturally, the big difference between the two print-outs should be that one is in sorted order.
For full credit, you must demonstrate your program to the instructor or a TA in the lab.