-1

We know in Java we can't achieve the multiple inheritance but can be achieved by the interface.

Here I am stuck. This is the situation,

interface A {
    void a();
}

interface B {
    void a();
}

class AB implements A, B {

    @Override
    public void a() {
//            which interface's method be implemented?
//            Log.d("TAG", "Name of Interface: " + /*get the name of interface*/);
    }
}

Please suggest me something.

Aman Gupta - ΔMΔN
  • 2,971
  • 2
  • 19
  • 39

1 Answers1

3

It does not matter which interface method is implemented, as there is only one method implemented. It can be refered by any of the interface.

Dinesh
  • 1,046
  • 1
  • 8
  • 17