Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

max of an array java

public int max()
    {
        int max = elementData[0];
        for (int i = 1; i < size; i++)
        {
            if (elementData[i] > max)
            {
                max = elementData[i];
            }
        }
        return max;
    }
 
PREVIOUS NEXT
Tagged: #max #array #java
ADD COMMENT
Topic
Name
5+9 =