名称: ! 逻辑非
例子:
boolean a=false;
if (!a) {
rect (30, 20, 50, 50);
}
if (a) {
line (20, 10, 90,80);
line(20, 80, 90, 10);
}
boolean a= true;
if (!a) {
rect(30, 20, 50, 50);
}
if (a) {
line (20, 10, 90, 80);
line (20, 80, 90, 10);
}
描述:转化一个表达式的布林值。当表达式为真的时候返回假,当表达式为假的时候返回真, 如果表达式(a>b)判定为真,那么!(a>b) 就判定为假
语法: !表达式
参数: 表达式 任何有效的表达式
相关的: || 逻辑或
&& 逻辑与
- 本文固定链接: http://iprocessing.cn/2017/07/04/logical-not逻辑非/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表