No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing

在Java中,类中的静态方法不能直接调用动态方法。只有将某个内部类修饰为静态类,然后才能够在静态类中调用该类的成员变量与成员方法。所以不做其他变动的情况下,最简单的解决办法是将public class改为public static class.

posted @ 2014-12-05 15:24  Liuxiaoke  阅读(237)  评论(0编辑  收藏  举报