Java Printing Functions

前端 未结 2 1389
再見小時候
再見小時候 2021-01-27 11:07

I need help writing the printing functions in this java application of another class.

The functions are with printAll I think is right and the other function is definite

2条回答
  •  余生分开走
    2021-01-27 11:57

    If DictionaryADT is a class with all the actual implementation, then you need to call

    I believe you have Map inside DictionaryADT then, something like

    public Collection values() {
        return dictionary.values(); 
    }
    

    to get the keys, Iterator is changed to Set

    public Set keys() {
        return dictionary.keySet(); // return Set, Please perform all the set opetations.
    }
    

    I believe this what you are looking for.

    Thanks, Bennet.

提交回复
热议问题