1 | 错误描述信息: |
在 new 一个内部类的对象时,idea 会生成如下的代码。
1 | // Info 是User的内部类 |
然后会提示报错 org.fairy.eye.domin.entity.User is not an enclosing class
如果内部类没有用 static
修饰的话,是不能这样 new 的。
需要有外部类实例对象来支持。
1 | User user = new User(); |
1 | 错误描述信息: |
在 new 一个内部类的对象时,idea 会生成如下的代码。
1 | // Info 是User的内部类 |
然后会提示报错 org.fairy.eye.domin.entity.User is not an enclosing class
如果内部类没有用 static
修饰的话,是不能这样 new 的。
需要有外部类实例对象来支持。
1 | User user = new User(); |