Computer Science, asked by wasukumeti4973, 10 months ago

Which method will implement if class extend two interface contains same method

Answers

Answered by Shayna008
0

Answer:

Hey friend!!

Thanks for asking!!

Here's your answer..

If a type implements two interfaces, and each interface define a method that has identical signature, then in effect there is only one method, and they are not distinguishable. If, say, the two methods have conflicting return types, then it will be a compilation error. This is the general rule of inheritance, method overriding, hiding, and declarations, and applies also to possible conflicts not only between 2 inherited interface methods, but also an interface and a super class method, or even just conflicts due to type erasure of generics.

Hope it helps!!

Please mark it as the brainliest..

Have a good day ahead :)

Similar questions