Question: public abstract class Container { // do not change the value of the following constant. protected final int Original_size= 8; protected Object[] checklist; // is
public abstract class Container { // do not change the value of the following constant. protected final int Original_size= 8; protected Object[] checklist; // is a container that stores the element of MyCheckList protected Object[] set; // is a container that stores the element of MySet protected int size; // this variable holds the actual number of elements that are stored in either of the containers (i.e. MyCheckList or MySet). /** * This method adds the obj to the end of the container. * @param obj is the object that is added to the container. */ void add(Object obj) { System.out.println("The object was added to the contianer"); } /** * This method removes the object at the given index * @param index is the index of the object that is removed. * @return returns the removed object. */ Object remove(int index) { // Change the return value. return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
