What is the difference between an interface and abstract class?

前端 未结 30 1752
情歌与酒
情歌与酒 2020-11-21 11:51

What exactly is the difference between an interface and abstract class?

30条回答
  •  囚心锁ツ
    2020-11-21 12:17

    An Interface contains only the definition / signature of functionality, and if we have some common functionality as well as common signatures, then we need to use an abstract class. By using an abstract class, we can provide behavior as well as functionality both in the same time. Another developer inheriting abstract class can use this functionality easily, as they would only need to fill in the blanks.

    Taken from:

    http://www.dotnetbull.com/2011/11/difference-between-abstract-class-and.html

    http://www.dotnetbull.com/2011/11/what-is-abstract-class-in-c-net.html http://www.dotnetbull.com/2011/11/what-is-interface-in-c-net.html

提交回复
热议问题