Is it possible to override only some abstract methods in interface among set of abstract methods?
Yes you can provided you make that class also as abstract.
Is it possible to override only some abstract methods in interface
Yes, but since the resulting class is still not fully concrete, this class has to be declared abstract.
This compiles fine:
interface MyInterface {
void method1();
void method2();
}
abstract class MyClass implements MyInterface {
public void method1() { }
}
(but it won't compile without the abstract modifier).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With