Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to implement two interfaces having same methods

 
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: 2539
9
  • 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
Saloon Keeper
Posts: 11021
12
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