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

推荐订阅源

T
Threat Research - Cisco Blogs
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tenable Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
Hacker News: Ask HN
Hacker News: Ask HN
Schneier on Security
Schneier on Security
H
Heimdal Security Blog
Simon Willison's Weblog
Simon Willison's Weblog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cyberwarzone
Cyberwarzone
V2EX - 技术
V2EX - 技术
W
WeLiveSecurity
Help Net Security
Help Net Security
S
Secure Thoughts
P
Privacy & Cybersecurity Law Blog
S
Securelist
SecWiki News
SecWiki News
P
Palo Alto Networks Blog
C
CERT Recently Published Vulnerability Notes
Know Your Adversary
Know Your Adversary
The Last Watchdog
The Last Watchdog
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
V
Vulnerabilities – Threatpost
H
Hacker News: Front Page
NISL@THU
NISL@THU
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Attack and Defense Labs
Attack and Defense Labs
Security Archives - TechRepublic
Security Archives - TechRepublic
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Google Online Security Blog
Google Online Security Blog
The Hacker News
The Hacker News
Cloudbric
Cloudbric
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
A
Arctic Wolf
Latest news
Latest news
S
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
Project Zero
Project Zero
P
Privacy International News Feed
B
Blog
云风的 BLOG
云风的 BLOG

博客园 - kuning的程序博客

第一章 第二课 Using Resources 第一章 第一课 Using WPF Control Cmd,powershell 参考 百度WSUS 我也转关于软件测试的文章 了解WMI 英文面试题 据说是微软面试哦 算法 之 万年历 算法 之 哥德巴赫猜想 - kuning的程序博客 C# 理论学习 之 面向对象设计 C# 深入学习 之 Winform记录日志 C#深入学习 之 委托和事件 C#数据结构-排序之快速排序法 .Net本地化资源 PHP之安装篇 Sql Server中的行列互换 再叙2005Web控件(一) - kuning的程序博客 - 博客园 Poket PC 与 sqlserver2000(以上) RDA 方案
C# 理论学习 之 类、组,名称空间
kuning的程序博客 · 2010-03-21 · via 博客园 - kuning的程序博客
  • 类的实例化的几种方式
  •    1.new关键字
  •    2.Create方法:没有可访问的构造函数,Create方法返回类实例的引用
  •    3.反射(Reflection),例如用插件的时候       
  •      实例化的类就是一个对象,对象的变量存放在数据栈中,对象本身存放在托管堆中
  • static使用
  1. 需要全局数据和代码,常量通常用static声明,不需要生成对象,全局只有一个副本
  2. 2.0中static可以修饰类,好处是类里的所有方法和字段都是静态的
  3. 只读字段和静态字段的区别
  • 常量和只读字段的区别

静态方面

  一旦赋值就不能改变了

初始化方面

  常量字段只能在声明时赋值

  只读字段可以在声明时赋值,也可以在构造函数中赋值

类型方面

   常量只能使用内置的类型(int,float,string…)

   只读字段可以使用引用类型(class等)

  • 名称空间
  1. 名称空间可以按逻辑对类进行划分(可以用名称空间划分项目组、分层结构等)
    1. 增强可读性
    2. 减少类名冲突
  2. 引用名称空间using推荐使用alias(别名):using SD=System.Data;
  • 组件
    1. Assembly=1 or more classes
    2. 程序集
    3. 和存放的物理位置有关,和命名空间无关