package example2;
public class Ex2_1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
final double PI=3.14159; //定义double类型常量PI
byte a; //定义 byte类型变量a
int b; //定义 int类型变量b
char c; //定义 char类型变量c
double d =2.5; //定义double类型变量d
a = 012; //给变量a赋值 该值为八进制12.十进制10
b = 100; //给变量b赋值100
c = 'A'; //给变量c赋值'A'
System.out.println(" PI= "+PI);
System.out.println(" a= "+a);
System.out.println(" b= "+b);
System.out.println(" c= "+c);
System.out.println(" d= "+d);
}
}
重捡JAVA,第一节 各类数据类型的定义
发布于 2022-09-22 1015 次阅读
Comments NOTHING