* 常量:在程序的执行过程中,其值不可以发生改变的量
*
*
* 常量分类:
* A:字母串常量:"HelloWorld"
* B:整数常量:12,,23,55,99
* C:小数常量:3.2,,—99.9
* D:字符常量:‘a’ ‘b’
* E:布尔常量:true , false
* F:空常量:null
*
*
*
*
*
*
* */
public class ChangLiang {
final String name = "月光";



public static void main(String[] args) {






//字符串常量
System.out.println("HelloWorld");

//整数常量
System.out.println(99);
System.out.println(23);
System.out.println(55);


//小数常量
System.out.println(23.32);
System.out.println(55.62);
System.out.println(33.78);
System.out.println(-66.66);


//字符常量
System.out.println('l');
System.out.println('o');
System.out.println('v');
System.out.println('e');

//部尔常量
System.out.println(true);
System.out.println(false);

posted on 2022-08-13 09:58  月光映寒窗  阅读(23)  评论(0)    收藏  举报