This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A class extending a class and implementing an interface with same methods ?

 
K Srinivasan
Ranch Hand
Posts: 34
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if a class extends another class and implements an interface both with the same method , which function will it implement ??

eg:



which show() does c implement ??

thanks.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The important thing is that the rules for the implementation of interfaces and abstract classes have been obeyed.

So, if you do


or



both will do the same thing...
 
John de Michele
Rancher
Posts: 600
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
'Albus':

Aren't you dead? You probably should change your username to your real name. Fake names are against the rules, and the moderators will get on your case.

John.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
albus dumbeldore wrote:which show() does c implement ??

From a pragmatic standpoint, what's the difference? If the signatures are the same, the implementing subclass will be an instance of both the superclass and interface (unless I'm misunderstanding something).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic