变量
public class Demon10 {
//类变量 static
static double salary = 2500;
//属性:变量
//实例变量:从属于对象;如果不自行初始化,则输出这个类型的默认值0、0.0
//布尔值默认false
//除了基本类型,其余的默认值都是full;
String name;
int age;
//main方法
public static void main(String[] args) {
//局部变量:必须声明和初始化值
int i = 10;
System.out.println(i);
}
}
输出:
10
Process finished with exit code 0
浙公网安备 33010602011771号