如果你有一个布尔变量:
boolean myBool = true;
我可以通过if/else语句来获取它的相反值:
if (myBool == true) myBool = false; else myBool = true;
是否有更简洁的方式来做到这一点?
用户名或邮箱地址
密码