Question: Hi Please help me with Java task Need to write generic methods with this collection HashMap and TreeMap, then test everything in RunnerClass All methods

Hi

Please help me with Java task

Need to write generic methods with this collection HashMap and TreeMap, then test everything in RunnerClass

All methods need to be generic

For example all methods looks like this one below , thats example for ArrayList methods :

-Method that will clear the given ArrayList:

public void clearList(ArrayList list)

{ list.clear();

In this example above, bolt the generic methods for HashMap and TreeMap

HashMap

1. Method that will return a shallow copy of the HashMap.

2. Method that will complete the HashMapa given as the first argument with elements from the HashMap given as the second argument

TreeMap

1. Method that will return the first key at least equal to or greater than the key passed in the argument (if such a key does not exist, it will return the next higher one);

2. Method that will return a SortedMap containing part of the TreeMapa where the keys are greater or equal to the key given as argument

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!