Task 4 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

9.2 Generic methods — maximum of any comparable type

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Fill in maxOf so that it returns the largest element. The bound <T extends Comparable<T>> is already written, so you may call compareTo — the > operator would not compile for T.

The program prints 9 and then pear — the same method for numbers and for words.

Your solution