Interface freeloading on a superclass - is it good practice?
- From: Chris Berg <spam.spam.eggs@xxxxxxx>
- Date: Mon, 15 Aug 2005 17:19:46 +0200
This appears to be legal:
public interface MyInterface {
void setEnabled(boolean enabled);
}
public class MyComponent extends java.awt.Component
implements MyInterface {
// setEnable() NOT implemented, 'cause it comes with Component
}
It compiles and runs, although it appears to me there is something
conceptually wrong. Shouldn't 'implemeting an interface' mean just
that, not freeloading on some superclass?
And will it always work, on any version of VM?
Some techniques can be technically ok but still considered bad
programming practice. What about this one?
Chris
.
- Follow-Ups:
- Re: Interface freeloading on a superclass - is it good practice?
- From: Roedy Green
- Re: Interface freeloading on a superclass - is it good practice?
- From: Andrew McDonagh
- Re: Interface freeloading on a superclass - is it good practice?
- From: jan V
- Re: Interface freeloading on a superclass - is it good practice?
- From: Chris Berg
- Re: Interface freeloading on a superclass - is it good practice?
- From: Jon Martin Solaas
- Re: Interface freeloading on a superclass - is it good practice?
- From: bugbear
- Re: Interface freeloading on a superclass - is it good practice?
- From: Monique Y. Mudama
- Re: Interface freeloading on a superclass - is it good practice?
- Prev by Date: Re: Can you detect if a class is mutable ?
- Next by Date: Re: Interface freeloading on a superclass - is it good practice?
- Previous by thread: problems locating the concurrent EDU.oswego.cs.dl.util.concurrent package
- Next by thread: Re: Interface freeloading on a superclass - is it good practice?
- Index(es):
Relevant Pages
|
|