public class Copy1a { public static void main(String[] args) { double[] a = { 1.1, 2.2, 3.3 }; // The original array double[] b; // The copy b = a; // is b a copy of a ??????? /* ==================================== Let's do an experiment.... ==================================== */ int i; /* ---------------------------------- Print the values before the update ---------------------------------- */ System.out.println("a array:"); for ( i = 0; i < a.length; i++) System.out.println( a[i] ); System.out.println("b array:"); for ( i = 0; i < b.length; i++) System.out.println( b[i] ); b[0] = b[0]+10; // Update one element in the copy // (This must not change the original) /* ---------------------------------- Print the values after the update ---------------------------------- */ System.out.println("Values after updating the copy b[0]:"); System.out.println("a array:"); for ( i = 0; i < a.length; i++) System.out.println( a[i] ); System.out.println("b array:"); for ( i = 0; i < b.length; i++) System.out.println( b[i] ); } }