A Sorted Integer List

File IntList.java contains code for an integer list class. Save it to your directory and study it; notice that the only things you can do are create a list of a fixed size and add an element to a list. If the list is already full, a message will be printed. File ListTest.java contains code for a class that creates an IntList, puts some values in it, and prints it. Save this to your directory and compile and run it to see how it works.

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.