object of abstract class type "我的类" is not allowed 解决方案

来源:互联网 发布:oracle java连接 编辑:程序博客网 时间:2024/06/13 20:09

想把派生类做成单例,

public: static 我的类* getInstance() {   
if( _uniqueInstance == 0 ) {   
_uniqueInstance = new 我的类(); //这里报错
}   
return _uniqueInstance;   
}   

 

报错为:object of abstract class type "我的类" is not allowed

 

原来是父类里的虚函数子类没有实现造成的。

原创粉丝点击