2.(Sorted list: array implementation)This sorted list ADT discussed in class should be extended by the addition of two new methods: //Interface: ArrayListADT //works for int public interface ArrayListADT { public boolean isEmpty(); //Method to determine whether the list is empty. public boolean isFull(); //Method to determine whether the list is full. public int listSize(); //Method to return the number of elements in the list. public int maxListSize(); //Method to return the maximum size of the list. public void print(); //Method to output the elements of the list. public boolean isItemAtEqual(int location, int item); //Method to determine whether item is the same as the item in the list at location. public void insertAt(int location, int insertItem); //Method to insert insertItem in the list at the position public void insertEnd(int insertItem); //Method to insert insertItem at the end of the list. public void removeAt(int location); //Method to remove the item from the list at location. public int retrieveAt(int location); //Method to retrieve the element from the list at location. public void replaceAt(int location, int repItem); //Method to replace the element in the list at location with repItem. public void clearList(); //Method to remove all the elements from the list. public int search(int searchItem); //Method to determine whether searchItem is in the list. public void remove(int removeItem); //Method to remove an item from the list. } //Class: ArrayListClass implements //Interface: ArrayListADT public abstract class ArrayListClass implements ArrayListADT { protected int length; //to store the length of the list protected int maxSize; //to store the maximum size of the list protected int[] list; //array to hold the list elements //Default constructor public ArrayListClass() { maxSize = 100; length = 0; list = new int[maxSize]; } //Alternate Constructor public ArrayListClass(int size) { if(size <= 0) { System.err.println(\"The array size must be positive. Creating an array of size 100.\"); maxSize = 100; } else maxSize = size; length = 0; list = new int[maxSize]; } public boolean isEmpty() { return (length == 0); } public boolean isFull() { return (length == maxSize); } public int listSize() { return length; } public int maxListSize() { return maxSize; } public void print() { for (int i = 0; i < length; i++) System.out.print(list[i] + \" \"); System.out.println(); } public boolean isItemAtEqual(int location, int item) { if (location < 0 || location >= length) { System.err.println(\"The location of the item to be compared is out of range.\"); return false; } return list[location]== item; } public void clearList() { for (int i = 0; i < length; i++) list[i] = 0; length = 0; System.gc(); //invoke the Java garbage collector } public void removeAt(int location) { if (location < 0 || location >= length) System.err.println(\"The location of the item to be removed is out of range.\"); else { for(int i = location; i < length - 1; i++) list[i] .