我有一个实现另外两个抽象类的单例类。My monkey::getMonkey失败,因为thisMonkey = new monkey()返回“抽象类类型的对象"monkey”is not allowed“。我知道您不能实例化抽象类,但我的猴子实现了两个抽象类(这意味着它不是抽象的。对吧?)
这个问题的解决方案是什么?
在我的Android应用程序中,我试图遵循MVVM模式,但在创建ViewModel.Error:Cannot create an instance of class DemoViewModel class.实例时出错。这是我的代码:class DemoFragment : Fragment(R.layout.fragment_demo) {
lateinit var mViewModel