理解抽象和部分类 [英] Understanding abstract and partial classes

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

问题描述

抽象类和部分类有什么区别?

What is the difference between abstract and partial classes?

推荐答案

分部类是一个分为多个文件的类。



它通常用于代码生成场景,其中代码生成器写入的类的一部分保存在一个文件中,而受到骚扰的人类写入的位保存在另一个文件中。在编译时,这两个文件被组合成一个类。



抽象类是一个无法直接实例化的类。相反,其他类必须继承它并添加/覆盖它们所需的功能。
A partial class is a class that is split across more than one file.

It is typically used in a code-generation scenario where the part of the class that the code generator writes is kept in one file and the bit a harassed human writes is kept in another file. At compile time these two files are combined to make the one class.

An abstract class is one that cannot be directly instantiated. Instead other classes must inherit from it and add/override the functionality they need.


试着找出:

部分类和方法(C#编程指南) [ ^ ]

抽象和密封类和类成员(C#编程指南) [ ^ ]
Try to find out:
Partial Classes and Methods (C# Programming Guide)[^]
Abstract and Sealed Classes and Class Members (C# Programming Guide)[^]


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

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