Question: Question 2 1 pts public interface List f *Returns the number of elements in the list. *@return number of elements in the list int sizeO;


Question 2 1 pts public interface List f *Returns the number of elements in the list. *@return number of elements in the list int sizeO; *Tests whether the list is empty boolean isEmpty() *Returns (but does not remove) the element at index i. Object get(int i) throws IndexOut0fBoundsException *Replaces the element at the specified index, and returns the element previously stored E set(int i, Object e) throws IndexoutOfBoundsException; Inserts the given element at the specified index of the list, shifting all *subsequent elements in the list one position further to make room void add (int i, Object e) throws IndexOutOfBoundsException; *Removes and returns the element at the given index, shifting all subsequent *elements in the list one position closer to the front Object remove(int i) throws IndexoutOfBoundsException; Consider the following sequence of operations on a List that begins empty. Give the return value for each line. If it causes an error, then write ERROR
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
