当前位置: 代码迷 >> 综合 >> No enclosing instance of type UpdataInfoParser is accessible. Must qualify the allocation with an en
  详细解决方案

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

热度:40   发布时间:2023-12-17 22:19:30.0

错误提示:

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

 (e.g. x.new A() where x is an instance of UpdataInfoParser).

解决方法:

静态方法只能调用静态内部类。

public  class UpdataInfo前加上static。


public class UpdataInfoParser

{

    public static UpdataInfo getUpdataInfo(InputStream is) throws Exception

   {

        UpdataInfo info = new UpdataInfo();

   }



    public  class UpdataInfo

   {

   }

}






  相关解决方案