Possible Duplicate:
Interface vs Abstract Class (general OO)
I want to开发者_开发百科 know the difference between an Interface and an Abstract class ?
I'm so confused about this.
Thanks already.
In an interface you simply define the methods that you are going to implement. In an abstract class you can actually write methods that contain some code. I'm sure this question has been asked a thousand times so look at some of the other posts.
Interfaces define contracts. Abstract classes provide for code reuse. An object interacts with other objects via their contracts (Interfaces). An object shares code with other, related, objects, by inheriting it from an abstract class.
精彩评论