Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

array find max in java

    public static void main(String[] args) {
        int [] arr = {100,200,300,50,40,-10,-50};
        int max = Integer.MIN_VALUE;
        for(int each: arr)
            if(each > max)
                max = each;
        System.out.println(max); // 300
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #find #max #java
ADD COMMENT
Topic
Name
6+2 =