CSC300 / CSC402: Arrays of Base Values [21/24] Previous pageContentsNext page

Try arrays, with utility functions in java.util.Arrays

int[] x = new int[] { 11, 21, 31 };
int[] y = new int[] { 11, 21, 31 };
x=[I@8807e25, y=[I@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
eqa01

Previous pageContentsNext page