+ 2
Math. max() method
Can we give only two parameters in Math. max();?
8 Antworten
+ 4
Hey, you could alternatively just add all the numbers to an array list of Integer and use the Collections.max() method to extract the largest number.
This saves time and gets rid of using multiple 'nested Math.max ()'
+ 4
Glad I could help!
+ 3
Yeah it is a static method which is part of the Collections class which is part of the util package so you will have to import java.util.Collections;
+ 3
I can indeed : min, sort, frequency etc but the best thing to do is to look at the Collections class java docs from oracle and see all of the many methods that are part of it.
+ 2
I got it.... its maxim range is 2.If we want to compare more numbers we have to use nested Math. max();
+ 1
Is Collections. max() an predefined method?
+ 1
Can you name some other methods of this Package?
+ 1
Thanks @Minato....