Question: Provide an ArrayList Class from scratch without using the help of outside libraries. booleanadd(Ee) Appends the specified element to the end of this list. voidadd(intindex,Eelement)
Provide an ArrayList Class from scratch without using the help of outside libraries.
booleanadd(Ee)
Appends the specified element to the end of this list.
voidadd(intindex,Eelement)
Inserts the specified element at the specified position in this list.
voidclear()
Removes all of the elements from this list.
booleancontains(Objecto)
Returnstrueif this list contains the specified element.
Eget(intindex)
Returns the element at the specified position in this list.
intindexOf(Objecto)
Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
booleanisEmpty()
Returnstrueif this list contains no elements.
intlastIndexOf(Objecto)
Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
Eremove(intindex)
Removes the element at the specified position in this list.
intsize()
Returns the number of elements in this list.
Object[]toArray()
Returns an array containing all of the elements in this list in proper sequence (from first to last element).
In Java language, Thanks for the help!
(If you explain with followed method, its will be appreciate! )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
