devxlogo

Java interfaces and constructors

Java interfaces and constructors

Question:
Is there a way to force a specific constructor with an interface?

Answer:
No, there is no way to force implementors of a given interface to use constructors with a specific signature. Interfaces can only be used to provide common method signatures.

devx-admin

Share the Post: