comparing arrays in java

后端 未结 6 1589
醉梦人生
醉梦人生 2020-12-03 12:58
int [] nir1 = new int [2];
nir1[1] = 1;
nir1[0] = 0;


int [] nir2 = new int [2];
nir2[1] = 1;
nir2[0] = 0;

boolean t = nir1.equals(nir2);
boolean m = nir1.toString         


        
6条回答
  •  醉酒成梦
    2020-12-03 13:15

    Use this:

    return Arrays.equals(perm1, perm2)
    

    Instead of this:

    return perm1.equals(perm2);
    

    Please have to look this

提交回复
热议问题