Can an interface have a constructor?
No, an interface cannot have a constructor in Java.
- Interfaces cannot be instantiated directly, so they don’t require constructors.
- Constructors are used to initialize objects, but since interfaces are not concrete classes, they don’t need one.
- Instead, classes that implement the interface must provide their own constructors.
In short: Interfaces cannot have constructors because they can’t be instantiated directly.