This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 2154
    
    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: 10170
    
    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
 
Similar Threads
How do I do a partial implemantation of an Interface
regarding interfaces
Exceptions and interfaces
Broader exceptions thrown by methods that implement interfaces
Interface method implementation