Processing, == (equality)
用法介紹。
用法
value1 == value2
參數
value1
整數、浮點數、字符、字節、布爾值value2
整數、浮點數、字符、字節、布爾值
說明
確定兩個值是否相等。請注意,相等運算符 (==) 與賦值運算符 (=) 不同,雖然它們看起來相似,但它們有不同的用途。如果要比較兩個變量,則相等運算符 (==) 僅適用於原始數據類型,如 int、boolean 和 char。它不適用於 Array、Table 和 PVector 等複合數據類型。
請注意,在比較 String 對象時,您必須使用 equals()
方法而不是 ==。有關詳細說明,請參閱 String 的參考或 troubleshooting 注釋。
例子
int a = 23;
int b = 23;
if (a == b) {
println("the values of variables 'a' and 'b' are the same");
}
相關用法
- Processing = (assign)用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
- Processing PVector.set()用法及代碼示例
- Processing FloatDict.sortKeysReverse()用法及代碼示例
- Processing texture()用法及代碼示例
- Processing IntDict.add()用法及代碼示例
- Processing PShape.enableStyle()用法及代碼示例
- Processing FloatDict.sub()用法及代碼示例
- Processing String用法及代碼示例
- Processing PImage.pixels[]用法及代碼示例
- Processing vertex()用法及代碼示例
- Processing PVector.mag()用法及代碼示例
- Processing thread()用法及代碼示例
- Processing Capture.stop()用法及代碼示例
- Processing Env.play()用法及代碼示例
- Processing StringList用法及代碼示例
- Processing parseJSONArray()用法及代碼示例
- Processing JSONArray.getIntArray()用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 == (equality)。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。