If I have a interface i
and a class c
, i
has a default method (Java8) and c
has a method with the same signature but with a different implementation. Which implementation applies to a class 3
that implements i
and extends c
?
Asked
Active
Viewed 51 times
0

Sandeep Sukhija
- 1,156
- 16
- 30
-
What happens if you have i and i2 with a method with the same signature and have a class implement them both? Ooooh now that's interesting – softarn May 30 '16 at 14:41
-
@softarn you get a compilation error. – Klitos Kyriacou May 30 '16 at 15:26
1 Answers
0
The method in C will be called. Class implementations have precedence to interfaces.

softarn
- 5,327
- 3
- 40
- 54