抽象和界面的区别 [英] abstract and interface difference

查看:63
本文介绍了抽象和界面的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

抽象类和接口类之间的区别是什么?当我们使用这些类时

解决方案

来自谷歌,它充满了所有这些例子和讨论:



抽象类与界面 [ ^ ]


< blockquote>接口定义了您的类必须实现的属性和方法。



抽象类

0)可能定义你的类必须实现的属性和方法如果它不是你的类不是抽象的。

1)可以有属性,方法和构造函数的实现



任何类只能继承其他类(抽象或不抽象),但可以实现多个接口。



更多细节见

接口(C#编程指南) [ ^ ]

抽象和密封的类和类成员(C#编程指南) [ ^ ]

接口和抽象类 [ ^ ]


Google搜索完全免费查找此类问题的答案。



Google搜索结果


what is the difference between abstract class and interface class and when we use these classes

解决方案

C'mon use google, it's full of all such examples and discussions:

Abstract Class versus Interface[^]


An interface defines properties and methods that your class must implement.

An abstract class
0) may define properties and methods that your class must implement if it's not your class is not abstract.
1) can have implementations of properties, methods and constructors

Any class can only inherit from one other class (abstract or not), but can implement multiple interfaces.

For more details see
Interfaces (C# Programming Guide)[^]
Abstract and Sealed Classes and Class Members (C# Programming Guide)[^]
Interfaces and Abstract Classes[^]


Google Search is absolutely free to find Answers of this type of Questions.

Google Search Result


这篇关于抽象和界面的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆