Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions

Question

Question Can employees make contributions to a profit sharing plan?

Answered: 1 week ago