Why won't my public void Constructor {} compile?

若如初见. 提交于 2019-11-26 23:19:53

Constructors have no return type. So not

// this is a "pseudo"-constructor
public void TransferService(){

but rather

// this is the real deal
public TransferService(){

Regarding,

Transaction is abstract and cannot be instantiated

Well, is it? Is the Transaction class an abstract class or an interface? Only you who has the code knows the answer to this. If this is true, then you'll need to use a concrete implementation of Transaction in your code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!