Question: Hi please help with Java task Need to write methods with generic type with ArrayList, LinkedList, HashSet and TreeSet. All methods need to be with
Hi please help with Java task
Need to write methods with generic type<> with ArrayList, LinkedList, HashSet and TreeSet.
All methods need to be with generic type
ArrayList:
1.Method that replaces the third element of the ArrayList passed in the argument with another element (also passed in the argument)
2.Method that will increase the size of a given ArrayList by the specified value.
3.Method that will trim the capacity of the ArrayList to the number of elements it currently has.
4.Method that will clear the given ArrayList.
LinkedList:
1.Method that inserts a given item into the selected LinkedList index.
2.Method that checks weather the given element exist in LinkedList.
3.Method that will check weather a given LinkedList is empty or not.
HashSet:
1.Method that will compar two set and return a collection of only those items that are common to both sets.
2. Method that will compare two HashSet- method is supposed to return boolean.
TreeSet:
1.Method that will return and remove the last element of the TreeSet passed in the argument.
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
