Java - I have an Interface say InterfaceA that has three methods - method1, method2, method3.
A final class implements this interface. This class and interface are in a Jar and their implementations are unknown.
The Method method2 of class is not working as per expectations. What are possible ways in which i can have the right implementation/override this method.
So the only way is to code your own class with
class Third implements TheInterfaceInQuestion {
FinalClass fc;
public Third() {
fc = new FinalClass();
}
@Override
public void method1() {
// call final class implementation
fc.method1();
}
@Override
public void method2() {
// new implementation
}
@Override
public void method3() {
// call final class implementation
fc.method3();
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.