This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This program won't compile. Because you cannot implement both interfaces in class C.
Compiler will be ambigious about method a(). Try to change the argument list in either A
or B, then will allow you to implement both the interfaces, as one method will be correctly
Lucas Smith wrote:OK, but a class can implement multpile interfaces. It's a particular example. Stay tuned!
Yes, Java supports implementing multiple interfaces --- but that doesn't mean that you can use the feature to get around overloading rules. You are not allowed to have to methods with the same signature and different return types in a class.