wood burning stoves*
The moose likes Beginning Java and the fly likes how to implement two interfaces having same methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to implement two interfaces having same methods " Watch "how to implement two interfaces having same methods " New topic
Author

how to implement two interfaces having same methods

abhishek kunal
Ranch Hand

Joined: Jul 27, 2009
Posts: 42
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

Joined: Jun 13, 2009
Posts: 2180
    
    7
Create separate class files to imlement each interface or create inner class to implement the interfaces.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10270
    
    8

abhishek kunal wrote:...,as a single method cannot suffice the needs of two interfaces....

Why do you say that?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

see here.


http://muhammadkhojaye.blogspot.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to implement two interfaces having same methods