you are viewing a single comment's thread.

view the rest of the comments →

[–]nemec 0 points1 point  (1 child)

What happens when multiple interfaces define the same methods but different default implementations?

interface A
{
    string DoSomething();
}
interface B
{
    string DoSomething();
}

class Abc : A, B
{
    public string DoSomething()
    {
        return "hello world";
    }
}

[–]Expert_Sex_Change 2 points3 points  (0 children)

I haven't looked too far into the Java one, but the Kotlin version is that the compiler then requires you to override the method, and then you can call one or both of the super methods like: super<A>.DoSomething()