会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
白清欢
博客园
首页
新随笔
联系
订阅
管理
2019年7月13日
No enclosing instance of type ReverseList is accessible. Must qualify the allocation with an enclosing instance of type ReverseList (e.g. x.new A() where x is an instance of ReverseList).
摘要: 我写的内部类是动态的,也就是开头以public class开头。而主程序是public static class main。在Java中,类中的静态方法不能直接调用动态方法。只有将某个内部类修饰为静态类,然后才能够在静态类中调用该类的成员变量与成员方法。所以在不做其他变动的情况下,最简单的解决办法是
阅读全文
posted @ 2019-07-13 13:19 白清欢
阅读(390)
评论(0)
推荐(0)
公告