CSC300: Arrays of Objects [21/23] Previous pageContentsNext page

Integer[] x = new Integer[] { 11, 21, 31 };
Integer[] y = new Integer[] { 11, 21, 31 };
x=[Ljava.lang.Integer;@8807e25, y=[Ljava.lang.Integer;@2a3046da
x=[11, 21, 31], y=[11, 21, 31]
                  x==y : false
   Objects.equals(x,y) : false
           x.equals(y) : false
    Arrays.equals(x,y) : true
eqa03

Previous pageContentsNext page