Logical Type
Java 基本型別 Primitive Data Types 種類
種類
型別
長度
值域
初值
使用建議
備註
boolean
true / false
false
X
範例
public class UsingBoolean {
public static void main(String[] args) {
boolean test = false;
System.out.println("布林變數 test 的值:" + test);
test = true;
System.out.println("布林變數 test 的值:" + test);
}
}
布林變數 test 的值:false
布林變數 test 的值:true
【 M@nGo 留言區 】 如有任何建議的地方,請前往芒果留言區留言。
最后更新于