常量分類:a>字面值常量 b>自定義常量
A>字面值常量
·字符串常量
·整數(shù) 常量
·小數(shù)常量
·字符常量
·布爾常量 true/false
·空長(zhǎng)量 null
class ConstantDemo {
public static void main(String[] args) {
//字符串常量的輸出
System.out.println("hello");
//整數(shù)常量的輸出
System.out.println(100);
//小數(shù)常量的輸出
System.out.println(100.10);
//字符常量的輸出
System.out.println('a');
//布爾常量的輸出
System.out.println(true);
}
}