Write a program to get the highest element from given input using one of the TreeSet methods.
Note the elements in TreeSet by default sorted in ascending order.
Input (TreeSet) |
Output (Integer) |
[10, 15, 25, 99, 40, 20, 30] |
99 |
[0, 21, 2, 31, 25, 30, 32, 22, 12] |
32 |
[1, 7, 2, 8, 3, 4, 5, 6] |
8 |
null |
null |