class Demo{
static{
int num;
int num2;
num=1;
}
public Demo(){}
public Demo(int num,int num2){
System.out.println(num+","+num2);
}
public void Show(){
System.out.println(num+","+num2);//报错,找不到符号
}
}
class Demo2{
public static void main(String[] args){
Demo d=new Demo();
d.Show();
} |
|