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

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.

Leave a Comment