re: Why Java Interfaces Are Terrible VIEW POST

re: My thoughts exactly with the dual constructors when I realized I couldn't set the inputs of the constructors to the same attribute within the class...

You can set them to the same attribute if they both inherit from/implement that attribute. For example, you could make your attribute an AmazonDynamoDB, and have a constructor that takes the real one, and a constructor that takes the fake one, and have them both set the same attribute to what they're given.

HOWEVER, this is more or less useless, because you could just make your constructor take an AmazonDynamoDB as well, and pass either type into that constructor.

code of conduct - report abuse