Now the error is toString() in A cannot override toString() in java.lang.Object; attempting to use
incompatible return type
1.1)Does it mean that Interfaces also implicitly extend Objects methods??
1.2)Is there any workaround for this other than changing return type back into String??
Here The following error(s) happen when both lines (8,9) are commented or one of them or none of them were commented...
" otherMethod() in B cannot override otherMethod() in C(sometimes A here); attempting to use incompatible return type"
2.1)Is this kind of scenario prohibited ??
2.2)If not , What is the solution for this???
There is no direct solution for scenario 2. If your class inherits two methods with same signature but different return types, then you can't override them. If there are two interfaces with a method which has same signature except for the return type, a single class cannot implement both the interfaces...