public class Java {
//定义了整型c,赋值为0,并且为静态
publicstatic int c = 0;
publicstatic void main(String[] args) {
//用类名.静态成员调用.没有变量接值的话,
//会报错
int a = Java.c;
System.out.println(a);
}
}
public class Java {
//定义了整型c,赋值为0,并且为静态
public static int c = 1;
public static void main(String[] args) {
//用类名.静态成员调用.没有变量接值的话,
int a = Java.c;
System.out.println(a);
}
}