vipul parmar vipul parmar - 3 months ago 11
Android Question

Creating and Storing an Dynamic array Android

for (int i=0;i<arr.length;i++){
arr[i] = finalsum;
System.out.println("--->aa"+arr[i]);
}


using this funcationality, array value is overriden. so, please tell me proper solution.

Answer

Use Arrays.fill(int[] array, int value), like this:

Arrays.fill(arr,finalsum);

For sorting use Arrays.sort(int[] array)

Arrays.sort(arr);
Comments