maximum size of array possible in java code example
Example 1: how to get the max value of an array java
public static double arrayMax(double[] arr) {
double max = Double.NEGATIVE_INFINITY;
for(double cur: arr)
max = Math.max(max, cur);
return max;
}
Example 2: maximum arrays size in java
int arr[] = new int[N];// Maximum Value Of N:2,147,483,647 (max int size)