Organizational Research By

Surprising Reserch Topic

implementing two interfaces in a class with same method which interface method


implementing two interfaces in a class with same method which interface method  using -'java,interface,override'

Two interfaces with same method names and signatures. But implemented by a single class then how the compiler will identify the which method is for which interface?

Ex:

interface A{
  int f();
}

interface B{
  int f();
}

class Test implements A, B{   
  public static void main(String... args) throws Exception{   

  }

  @Override
  public int f() {  // from which interface A or B
    return 0;
  }
}   

    

asked Sep 10, 2015 by VanCrump
0 votes
4 views



Related Hot Questions

6 Answers

0 votes
NULL
answered Sep 10, 2015 by LelaChidley
0 votes
NULL
answered Sep 10, 2015 by ArdPoulin
0 votes
NULL
answered Sep 10, 2015 by TessaMayorls
0 votes
NULL
answered Sep 10, 2015 by BenitoI29uk
0 votes
NULL
answered Sep 10, 2015 by SelThorne
0 votes
NULL
answered Sep 10, 2015 by SioMinaya

...