I have two questions regarding interfaces in Java.
1) If a class happens to implement all the interface methods of interface I, without declaring itself as implementing them, can it still be used as input into variables of type I?
2) Does a subclass of class A which implements interface I inherits the conformance to that interface, or should it also declare itself as implementing I?
I have two questions regarding interfaces in Java. 1) If a class happens to
Share
No. What you’re describing is more akin to duck typing.
Assuming you mean:
In this case,
BimplementsI.