compare 2 2Dimensional arrays - Java -
compare 2 2Dimensional arrays - Java -
why isn't true?
int[][] arrayofsets = {{1,2},{9,10},{1,2},{3,5}}; int[][] test = {{1,2},{9,10},{1,2},{3,5}}; if(arrayofsets==test){ //{{1,2},{9,10},{1,2},{3,5}}){ system.out.println("exactly same"); }
the output should "exactly same". or how can compare 2 variables 2dimensional arrays?
you utilize ==
thats why failed, it's identical of object check utilize :
boolean check = arrays.deepequals(arrayofsets, test);
java multidimensional-array compare
Comments
Post a Comment