Cannot instantiate the type

Cannot instantiate the type

在service中无法实例化dao时,一般要么是构造函数时写的不是public而是private,另一个可能是自己建立类(class)的时候自动构造的函数是在这里插入图片描述可以看出图片中用abstract修饰的类 总结:当出现这个问题时就检查类的构造函数是否是private,或者这个类是否是抽象类 就可以了。