create a function that create a array in java code example
Example 1: Write a method that takes a parameter int size and returns an int[] array of that size.
public int[] makeArray(int size)
{
int[] arr = new int[size];
for(int i = 0; i < arr.length; i++)
{
arr[i] = 0;
}
return arr;
}
Example 2: Declare, instantiate, initialize and use a one-dimensional array
data = new Double[10];