-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.

1
  • 1
    it's not "overridden", it's implemented. and it's both, clearly. Commented Aug 23, 2018 at 8:13

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.