
未解决的问题
danchaofan0534
这个作者很懒,什么都没留下…
展开
-
一个困扰很久的问题:接口和Object到底什么关系?
如题,他俩到底什么关系? 1.接口继承Object 这种说法支持较多。 反例1:但是public interface IStudent extends Object编译器报错The type Object cannot be a superinterface of IStudent; a superinterface must be an interface,大意是接口只能实现接口,不能继承原创 2017-04-21 16:50:49 · 1135 阅读 · 4 评论 -
一个困扰很久的问题(二):Spring容器注入静态引用,报错空指针
举个例子:某Controller @Resource private static Service service; public void test(){ service.findById(1); } 如上例,将在service.findById(1)报空指针异常。 在网上看了很多解答,都是说spring容器是对象层面的 ,而static修饰的变量是类层面的,所以空指针。个原创 2017-04-24 16:47:41 · 1945 阅读 · 0 评论