Question: Write a java method named max that takes any number of integer parameters and return their maximum. (Hint: use vararg) For example, the max method
Write a java method named max that takes any number of integer parameters and return their maximum. (Hint: use vararg) For example, the max method can be called in any of the following ways:
x = max (4) ; // x = 4
x = max (1, 6, 3) ; // x = 6
x = max (5, 1, 5, 7, 9, 2, 20, 15, 13) ; // x = 20
Write a java program called Maximum to demonstrate this method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
