/* read array data from a file; call a method to change array value (reverse the order of elements) */ import java.util.Scanner; class ReverseArrayDemo { public static void main(String[] args) { Scanner input = new Scanner(System.in); double[] vals = new double[100]; int size = 0; while(input.hasNextDouble()) { vals[size] = input.nextDouble(); size ++; } // output all elements of the array to monitor outPutArray(vals, size); System.out.print("\n\nsize = " + size + "\n\n"); Reverse(vals, size); // output all elements of the array to monitor outPutArray(vals, size); System.out.println("\n\n\n\n"); } //------------------------------------- private static void outPutArray(double[] arr, int size) { for(int i=0; i