惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
V
Vulnerabilities – Threatpost
Last Week in AI
Last Week in AI
I
InfoQ
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Help Net Security
D
Docker
www.infosecurity-magazine.com
www.infosecurity-magazine.com
B
Blog RSS Feed
Forbes - Security
Forbes - Security
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Latest news
Latest news
S
SegmentFault 最新的问题
J
Java Code Geeks
C
CXSECURITY Database RSS Feed - CXSecurity.com
MongoDB | Blog
MongoDB | Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
F
Full Disclosure
Engineering at Meta
Engineering at Meta
AWS News Blog
AWS News Blog
月光博客
月光博客
Cisco Talos Blog
Cisco Talos Blog
V
Visual Studio Blog
雷峰网
雷峰网
博客园_首页
Project Zero
Project Zero
美团技术团队
Google DeepMind News
Google DeepMind News
IT之家
IT之家
P
Palo Alto Networks Blog
有赞技术团队
有赞技术团队
S
Security @ Cisco Blogs
U
Unit 42
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Security Archives - TechRepublic
Security Archives - TechRepublic
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
S
Schneier on Security
TaoSecurity Blog
TaoSecurity Blog
The Register - Security
The Register - Security
WordPress大学
WordPress大学
T
Threat Research - Cisco Blogs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
Help Net Security
Help Net Security

博客园 - yfcomeon

浅谈C#托管程序中的资源释放问题 (转载) 静态构造函数的执行时机 详解javascript类继承机制的原理 通用高效分页存储过程 Attributes in C# 组装机 散列基本概念知识点 C#的6种常用集合类大比拼 C#中的集合类 C#中的集合类 C#里的委托和事件实现 C#类和接口及值类型和引用类型的区别 vc调试器 变量的域 SQL数据库空间不足怎么办 分页 B树算法 转:sql server系统表详细说明 转:sql server系统表详细说明
C#方法修饰符
yfcomeon · 2007-10-29 · via 博客园 - yfcomeon

C#中方法除了private,public,pritected修饰符,还有new,virtual,override,sealed和abstract等5种修饰符等可以支持多态。

 修饰符

说明
static  该方法是类的一部分,而不是类实例的一部分。这意味着可以指定classname.method(parameters)来支持访问类,而无需创建类实例。
virtual 指示该方法可以在子类中覆盖,它不能与static或private访问该修饰符一同使用。
override 指示该方法覆盖了基类中的同名方法,这样它就能定义子类特有的行为。基类中被覆盖的方法必须是virtual(虚方法)
new 允许继承类中的一个方法“隐藏”基类中同名的非虚方法。它会取代原方法,而不是覆盖
sealed

禁止派生类此方法:
a.用在派生类中,该类又会作为基类派生自己的类
b.必须与override修饰符一起使用

abstract 该方法不包含具体实现细节,而且必须由子类。只能用做abstract类的成员。
extern 指示该方法是在外部实现的。它常与dllimport属性一起使用。DLLImport属性指示要由一个DLL提供实现细节