{ public int Size(); public boolean add(E obj); public void add(int E obj); public E get(int index); public E set(int index, E obj); public E remove(int index); } The detailed comments that were provided with the MyIntList class will not be used again with the implementation of the MyList class. The logic of the methods is identical. The key observation is to see the locations and the use of capital letter E, which makes this a generic class. Now do not get confused, it is not letter E that creates a generic class. It is the class heading MyList<E> class that starts the generic process. I could also have used class MyList<Aardvark> and if I now replace every instance of with the class will be E Aardvark, identical in action. The E instances will be highlighted in figure 14.38. Figure 14.38 class MyList<E> implements List<E> { private Object private int size; public MyList() { array = new Object[10000]; size = 0; } public int Size() { return size; } public boolean add(E obj) { array[size] = obj; size++; return true; } public void add(int index, E obj) { for (int k = size; k >= index; k--) array[k] = array[k-1]; array[index] = obj; size++; } public E get(int index) { return (E) array[index]; } public E set(int index, E obj) { E temp = (E) array[index]; = obj;
{ public int Size(); public boolean add(E obj); public void add(int E obj); public E get(int index); public E set(int index, E obj); public E remove(int index); } The detailed comments that were provided with the MyIntList class will not be used again with the implementation of the MyList class. The logic of the methods is identical. The key observation is to see the locations and the use of capital letter E, which makes this a generic class. Now do not get confused, it is not letter E that creates a generic class. It is the class heading MyList<E> class that starts the generic process. I could also have used class MyList<Aardvark> and if I now replace every instance of E with Aardvark, the class will be identical in action. The E instances will be highlighted in figure 14.38. Figure 14.38 class MyList<E> implements List<E> { private Object private int size; public MyList() { array = new Object[10000]; size = 0; } public int Size() { return size; } public boolean add(E obj) { array[size] = obj; size++; return true; } public void add(int index, E obj) { for (int k = size; k >= index; k--) array[k] = array[k-1]; array[index] = obj; size++; } public E get(int index) { return (E) array[index]; } public E set(int index, E obj) { E temp = (E) array[index]; = obj;