Write a complete program with two generic methods: maxOf with the bound <T extends Comparable<T>> returning the largest element, and countOccurrences counting elements equal to a target.
Read a count, that many words, and then one more word to search for. Print the alphabetically largest word, then how many times the search word appears.
For 3, pear apple fig, apple:
pear
1
maxOf needs the bound to call compareTo; countOccurrences works unbounded because equals exists on every object.