常量8
-
int name = 010
int name1 = 011,name2=012;
public class dome4 {
//类变量:+static;能够直接输出
static double num = 2000;
//实例变量:从属对象(类里面);如果不自行初始化,会变默认数值
String name;
int age;
//main方法里的为局部变量
public static void main(String[] args) {
//局部变量必须声明和初始化值‘
int $1 = 10;
dome4 dome4 = new dome4();
}
}
常量
public class dome5 {
//修饰符,不存在先后顺序
static final double PE = 232;
final static double PR = 213;
public static void main(String[] args) {
System.out.println(PE);
System.out.println(PR);
}
}