Hi,
I tried this program by making some changes in that :
public class Program1
{
public int[] InstantiateArray(int[] array) // Note the return type
{
for (int i=0; i <array.length; i++)
{
array[i] = i;
}
EvaluateArray(array); // Calling the EvaluateArray method.
return array; // returning the changed array
}
public int[] EvaluateArray(int[] array) // Note the return type
{
for (int i=0; i <array.length; i++)
{
array[i] = i*2;
}
return array; // returning the changed array
}
public static void main(
String[] args)
{
int[] array = new int[10];
Program1 pr1 = new Program1();
pr1.InstantiateArray(array); // call to the first method
System.out.println("length "+array.length);
for (int i=0; i <array.length; i++)
{
System.out.println(array[i]);
}
}
}
Hope this helps!!
Thanks
JEAN