AbsHandle handle = new ProductInfo();
AbsHandle handle = ProductInfo.getInstance();请问这两句有什么区别吗?我下面一句可以编译,上面一句却报错。我不知道他们的区别在哪儿,哪位知道请麻烦告诉我一下?谢谢!
AbsHandle handle = ProductInfo.getInstance();请问这两句有什么区别吗?我下面一句可以编译,上面一句却报错。我不知道他们的区别在哪儿,哪位知道请麻烦告诉我一下?谢谢!
AbsHandle handle = ProductInfo.getInstance();
可能原因:ProductInfo是一个抽象类,因为抽象类不可以实例化.