2 Phonebookutils Task Public Final Class Phonebookutils Utility Class Means Intend Instant Q37125994

2. PhoneBookUtils Task:

public final class PhoneBookUtils : this is a utility class, whichmeans that we do not intend to instantiate it at all. Instead, wewill use the static helper methods it provides while writing otherclasses.

In our phone book application, the utility class implements thefollowing static methods:

  • public static <KeyType, ValueType> String mapToString(Map<KeyType, ValueType> map): a generic method which receives aMap and returns a string containing all of the the map’s “entries.”It should use the toString() method of each map entry, and place anewline after each entry so that there is one entry per line.
  • public static <T extends Comparable<T>> StringlistToSortedList(List <T>
    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.