/** * This program shows references to arrays */ class SameArray { public static void main (String[] args) { int [] a; int [] b; a = new int[] {0, 3}; b = new int[] {0, 3}; if (a==b) System.out.println( "The arrays are the same "); else System.out.println( "The arrays are not the same "); //make b point to a; b = a; if (a==b) System.out.println( "After copying the reference the arrays are the same "); else System.out.println( "After copying the reference arrays are not the same "); } }