kotlin中判断装箱后的Int值是不是相等

2025-03-20 21:54:18
推荐回答(1个)
回答1:

通过==判断两个int值是否相等。举例:

int a=1;//定义一个int型数值
int b=2;//定义一个int型数值
if(a==b){//用==判断是否相等
//相等
}else{
//不相等
}