day01-java中的常量的输出
This commit is contained in:
20
day01/src/com/inmind/Demo02Constant.java
Normal file
20
day01/src/com/inmind/Demo02Constant.java
Normal 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:空常量,用来给引用数据类型初始化的,以后再说
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user