CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Generic Max Method

Java quiz · Question 32
mediumGenerics, Methods

What does this generic method return when called as max(3, 7)?

Code

1public static <T extends Comparable<T>> T max(T a, T b) {
2 return (a.compareTo(b) >= 0) ? a : b;
3}