【发布时间】:2014-12-26 06:39:53
【问题描述】:
我需要将 int[] 数组与整数值进行比较。这段代码有
int c1[], c2[], c3[];
int count1=0, count2=1, count3=0;
c1 = new int[] { count1 };
c2 = new int[] { count2 };
c3 = new int[] { count3 };
现在我需要将此 int[] 数组与 int 进行比较,即任何数组等于 0 则代码不需要执行,如果不等于则代码执行。怎么比较??帮助我提前谢谢?这个 if 条件我试过了,但它不会完全执行。
if(c1.equals(0))
{
// skip
}
else
{
// execute code
}
上面的代码不起作用。
【问题讨论】:
-
我认为这个问题很相似[在此处输入链接描述][1] [1]:stackoverflow.com/questions/9710947/android-compare-arrays