Question: Question # 0 1 : Create a generic class called MyArrayList that includes the following instance methods: 1 . add ( index , value )
Question #: Create a generic class called MyArrayList that includes the following instance methods:
addindex valueinserts given value just before the given index, shifting subsequent values to the right
indexOfvaluereturns first index where given value is found in list if not found
removeindexremovesreturns value at given index, shifting subsequent values to the left
setindex valuereplaces value at given index with given value
toStringreturns a string representation of the list such as
addAlllistadds all elements from the given list to this list at the end of the list
revers reverses the ArrayList.
palindrome Returns the number of missing elements required to transform the ArrayList into a palindrome.
Write a Java program to test all the methods of your MyArrayList class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
