day01-java中的常量的输出

This commit is contained in:
2026-01-13 15:53:01 +08:00
parent a48de2cb7b
commit b684322d30

View File

@@ -0,0 +1,20 @@
package com.inmind;
public class Demo02Constant {
//程序的主入口main方法
public static void main(String[] args) {
//常量的定义,打印java中的各种常量
System.out.println(200);//整数常量
System.out.println(1.1);//小数常量
System.out.println('a');//字符常量,注意,有且仅有一个内容
System.out.println("");//字符串常量
System.out.println("abc");
System.out.println("我们");
//复制一行ctrl+D
System.out.println(true);//布尔常量
System.out.println(false);
// null:空常量,用来给引用数据类型初始化的,以后再说
}
}