比较运算符的结果一定是boolean类型

boolean test1 = (a==b);

//无法编译

boolean test1=(a=b); 

//同理,注意

int c=(a =b)不能写成 (a==b)。

你可能感兴趣的:(比较运算符,java,比较运算符)