aspose file tools
The moose likes Beginning Java and the fly likes A class extending a class and implementing an interface with same methods ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "A class extending a class and implementing an interface with same methods ?" Watch "A class extending a class and implementing an interface with same methods ?" New topic
Author

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

K Srinivasan
Ranch Hand

Joined: Mar 08, 2010
Posts: 34
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

Joined: Feb 23, 2009
Posts: 1183
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...


JDBCSupport - An easy to use, light-weight JDBC framework -
John de Michele
Rancher

Joined: Mar 09, 2009
Posts: 600
'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

Joined: Sep 29, 2008
Posts: 12617

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: A class extending a class and implementing an interface with same methods ?
 
Similar Threads
Classes: Abstract And Interface
How do I extend and implement same method from an abstract class and interface
Doubt regarding interface implementation
doubt interface, abstract class