C
Chris Berg
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
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