文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>为什么main方法中无法实例化非静态内部类

为什么main方法中无法实例化非静态内部类

时间:2010-07-17  来源:dracularking

No enclosing instance of type close is accessible. Must qualify the allocation with an enclosing instance of type close (e.g. x.new A() where x is an instance of close).

对main方法而言,它是游离于任何类之外的,因此某类的非静态内部类对它而言是不直接可见的,也就无法直接访问,like this:

enclosingInstance = new EnclosingClass();
nestedInstance = enclosingInstance.new NestedClass();

相关阅读 更多 +
排行榜 更多 +
我剪得贼准

我剪得贼准

休闲益智 下载
叶罗丽花园梦

叶罗丽花园梦

休闲益智 下载
剑侠逍遥

剑侠逍遥

角色扮演 下载