Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to implement two interfaces having same methods  RSS feed

 
abhishek kunal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
suppose i have two interfaces ... interface i1 and i2 and both have method of exact signature.....

public void called(), so if i am implementing both of them,then how to override(define) two different methods(one for interface i1 and another for interface i2 ). as compiler will not allow two method of exact signature in a class or other entities...so how we gonna give two methods for these two interfaces,as a single method cannot suffice the needs of two interfaces....
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create separate class files to imlement each interface or create inner class to implement the interfaces.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abhishek kunal wrote:...,as a single method cannot suffice the needs of two interfaces....

Why do you say that?
 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!