文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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();

相关阅读 更多 +
排行榜 更多 +
方块枪战战场安卓版

方块枪战战场安卓版

飞行射击 下载
战斗火力射击安卓版

战斗火力射击安卓版

飞行射击 下载
空中防御战安卓版

空中防御战安卓版

飞行射击 下载