为了账号安全,请及时绑定邮箱和手机立即绑定

public class Souter {

int a = 99;

static int b =1;

public static class Sinner{

int b = 2;

public void show(){

System.out.println("静态外部类调用"+Souter.b);

System.out.println("静态内部类调用"+b);

}

}

public static void main(String[] args) {

       Sinner.si=new Sinner();

       si.show();

}

}

测试错误提示:

Exception in thread "main" java.lang.Error: Unresolved compilation problems: 

si cannot be resolved or is not a field

si cannot be resolved

问为什么?

正在回答

1 回答

Sinner.si=new Sinner();

多了一个点

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Java入门第二季 升级版
  • 参与学习       530714    人
  • 解答问题       6091    个

课程升级!以终为始告别枯燥,在开发和重构中体会Java面向对象编程的奥妙

进入课程
意见反馈 帮助中心 APP下载
官方微信