public class Xxx{
//类变量
static int a = 10;
//实例变量
int b = 20;
String c = "123";
//方法:main
public static void main(String[] args){
//类变量:可以直接输出
System.out.println(a);
//实例变量:若需要在方法下使用,需要将实例变量的类拿到方法内
Xxx xxx = new Xxx();
System.out.println(xxx.d);
System.out.println(xxx.e);
//局部变量:在{}之间有效,必须初始化值才能输出
int d = 30;
String e = "456";
}
}