public class anonarray0 { public static void main(String[] args) { double[] r = randomArray(); for (int i = 0; i< r.length; i++) System.out.print(r[i] + " "); System.out.println(); } // Generate an array of three values: private static double[] randomArray() { return new double[] { Math.random(),Math.random(),Math.random() }; } }