get Max Number from int array - Android java.lang

Android examples for java.lang:array

Description

get Max Number from int array

Demo Code

public class Main{


    public static int getMaxNumber(int[] paramArray) {
        int temp = paramArray[0];
        for (int i = 0; i < paramArray.length; i++) {
            if (temp < paramArray[i]) {
                temp = paramArray[i];//from   w ww .  j av  a 2 s. c o  m
            }
        }
        return temp;
    }

}

Related Tutorials