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

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -