This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / ask for help: What is the diffrence between an Abstract class and interface. I'm so sorry not tell the difference between them. thank you!
-howru(How are you?);
2001-2-23
(#28161@0)
-
I have ever posted something about this problem here.
-jabber(jabber);
2001-2-23
(#28212@0)
-
my limited understandingAbstract classes might include both clearly or not clearly defined methods. The inheritors of abstract classes will override or define these methods.
Interfaces are kind of abstract class that contain no any clearly defined methods. it just provides a common frame for inheritors.
-ely(Ely);
2001-2-23
{281}
(#28215@0)
-
Does it mean: Abstract class can have some methods to be used directly by the object, comparing with Interface can have only method name, we must implement them before we use.
-howru(How are you?);
2001-2-23
(#28240@0)
-
my understanding is it's more often to override methods of abstract classes instead of using it directly..
I'm also a java learner..
-ely(Ely);
2001-2-23
(#28244@0)
-
Notice that: you can inherite from only one class, but you could implement several interfaces. This might be the main point when you choose abstract class or interface.
-bloor(bloor);
2001-2-23
(#28217@0)
-
I believe it's the point.
-ely(Ely);
2001-2-23
(#28245@0)
-
All the methods in the interface are implicitly abstract.
-rosemary(kitty);
2001-2-23
(#28243@0)
-
abstract class can have variable , normal method,etc; but interface can't.
interface is kind of pure "abstract class".
-guest:j++;
2001-2-23
(#28271@0)
-
I remember that Interface can have variable if it's Final Static.
-howru(How are you?);
2001-2-24
(#28276@0)