| Author |
Empty abstract classs vs Empty interface
|
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
|
|
whats a difference between an empty abstract classs and an empty interface? Regards
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9948
|
|
|
In a single class, you can implement as many interfaces as you want, but you can only inherit from one abstract class.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
A Kumar
Ranch Hand
Joined: Jul 04, 2004
Posts: 973
|
|
|
A friend of mine was asked this question and she replied the same as you mentioned. But he wasnt satisfied. So is there more to it than just one explanation.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
|
Who wasn't satisfied? Your friend is "she" so this "he" is a third person. Seems to me that's the person you should be asking.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
Well, an empty interface has a special name (a "marker interface"), and the JDK contains a number of examples of how they used to be used, back before annotations were introduced in Java5. An empty abstract class -- well, that's just dumb
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: Empty abstract classs vs Empty interface
|
|
|