So I am a college student just looking for a little help and understanding, I have a professor that does not allow us to use java pre-written classes such as ArrayList, so I am trying to figure out how to modify my current encapsulated array class to use generics so that I don't have to do so much casting in the application class of my program

```
public class ArrayClass {
    private Object[]  objArray;
    private int index = 0;
    public static final int MAX_SIZE = 100;

    public ArrayClass(){
        objArray = new Object[100];
    }

    public ArrayClass(int numSlots){
        objArray = new Object[numSlots];
    }
    public ArrayClass(Object[] anArray, int newIndex){
        objArray = new Object[newIndex];
        for(int i=0; i<newIndex; i++){
            objArray[i] = anArray[i];
        }
        index = newIndex;
    }

    //return object array, accessor
    public Object[] getstrArr(){
        return objArray;
    }
    //return # of actual data in array, accessor
    public int getIndex(){
        return index;
    }
    //return an object at given pos, accesor
    public Object getObject(int pos){
        return objArray[pos];
    }

    //assign a new object array, mutator
    public void setObjArr(Object[] aStrArr){
        for(int i=0; i<index; i++){
            objArray[i] = aStrArr[i];
        }
    }
    //assign a new index, mutator
    public void setIndex(int anIndex){
        index = anIndex;
    }
    //insert a new string into the array if there is room, increment index
    public void add(Object someObj){
        if(index < objArray.length){
            objArray[index] = someObj;
            index++;
        }
    }

    //return the string with contents of array
    public String toString(){
        String output = " ";
        for(int i=0; i<index; i++){
            output = output + objArray[i].toString();
        }
        return output;
    }

    //return true if calling object is equivalent to argument
    public boolean equals(Object someObj){
        for(int i=0; i< index; i++){
            if(objArray[i].equals(someObj))
                return true;
        }
        return false;
    }
}

```