位置:首頁 > 軟件操作教程 > 編程開發(fā) > Java > 問題詳情

Java Boolean類中的常量

提問人:劉旭39發(fā)布時間:2020-11-27

Boolean類中的常量

代碼如下所示

//Boolean類中的常量

public class BooleanConstant {

public static void main(String[] args) {

Boolean trueConst = Boolean.TRUE;

Boolean falseConst = Boolean.FALSE;

Class classType = Boolean.TYPE; 

System.out.println("對應(yīng)true的對象:"+ trueConst); 

System.out.println("對應(yīng) false的對象:" +falseConst);

System.out.println("對應(yīng)Boolean類型的Class對象:"+ classType);

}

}

image.png

繼續(xù)查找其他問題的答案?

相關(guān)視頻回答
回復(fù)(0)
返回頂部