| Author |
how to implement two different definition for class which implements two interface with same method
|
Sandeep Kethepalle
Greenhorn
Joined: Sep 16, 2010
Posts: 1
|
|
Hi
I have an interface called Interface1
I have another interaface called Interface2
I have a class which implements two interface which should have different definitions for two methods
example
It is giving me compilation error .But i need to implement in this same manner.I have been fiddling with last 2 days .Can anyone please help me
Thanks in advance
Regards
K.Sandeep
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
Welcome to the ranch!
You can only have one display() method. You make that one method do what both interfaces specify. If that's not possible for any reason then you simply cannot do this.
Also, please UseCodeTags next time. See how much easier it is to read my piece of code?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32654
|
|
Since he's new, I'll edit his code and see how much better it looks.
|
 |
 |
|
|
subject: how to implement two different definition for class which implements two interface with same method
|
|
|