Question: How would I implement a linkedList using the EntryIterator and iterator method used in the following classes in a HashTable Main Class? public String[] getKeys()

How would I implement a linkedList using the EntryIterator and iterator method used in the following classes in a HashTable Main Class?


public String[] getKeys() {        String[] keys = new String[size];      


 int index = 0;      


 for (MyLinkedList list : table) {            if (list != null) {             


   MyLinkedList.EntryIterator iterator = list.iterator();               


 while (iterator.hasNext()) {                    Entry entry = (Entry) iterator.next();      


keys[index] = entry.key;           


         index++;  


            }     


       }     


   }    


   return keys;

Step by Step Solution

3.51 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement a linked list using the EntryIterator and iterator method within a HashTable main class you need to define a custom MyLinkedList class th... View full answer

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 Programming Questions!