A class extending a class and implementing an interface with same methods ?
K Srinivasan
Ranch Hand
Joined: Mar 08, 2010
Posts: 34
posted
0
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
posted
0
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
posted
0
'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.
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 ?