Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi looking for help with Java task I have to write in Java- generic method with ArrayList, LinkedList, HashSet and TreeSet . All methods need

Hi looking for help with Java task

I have to write in Java- generic <> method with ArrayList, LinkedList, HashSet and TreeSet . All methods need to be generic and need to test them in TestRunnerClass

Please help me with this task

With ArrayList :

1. A generic method that replaces the third element of the ArrayList passed in the argument with another element (also passed in the argument).

2. A generic method that will increase the size of a given ArrayList by the specified value.

3. A generic method that will trim the capacity of the ArrayList to the number of elements it currently has.

4. A generic method that will clear the given ArrayList.

With LinkedList

1. A generic method that inserts a given item into the selected LinkedList index

2. A generic method that checks whether a given element exists in LinkedList

3. A generic method that will check whether a given LinkedList is empty or not

4. A generic method that will return a LinkedList of boolean, the method is to compare the elements of two LinkedLists - if two LinkedLists have all, e.g. 3 elements the same, then the LinkedList should look like this: [true, true, true].

TreeSet:

1. A method that will return and remove the last element of the TreeSet passed in the argument;

2. A method that will return an element lower than the object specified in the argument. In the Argument, you must also specify the given TreeSet

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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

6. How would you design your ideal position?

Answered: 1 week ago