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

推荐订阅源

Cloudbric
Cloudbric
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
D
DataBreaches.Net
Microsoft Azure Blog
Microsoft Azure Blog
Recorded Future
Recorded Future
Martin Fowler
Martin Fowler
M
MIT News - Artificial intelligence
U
Unit 42
爱范儿
爱范儿
F
Full Disclosure
Google Online Security Blog
Google Online Security Blog
腾讯CDC
小众软件
小众软件
A
Arctic Wolf
云风的 BLOG
云风的 BLOG
Webroot Blog
Webroot Blog
B
Blog RSS Feed
Project Zero
Project Zero
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 聂微东
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CXSECURITY Database RSS Feed - CXSecurity.com
SecWiki News
SecWiki News
S
Schneier on Security
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
W
WeLiveSecurity
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
WordPress大学
WordPress大学
MongoDB | Blog
MongoDB | Blog
G
Google Developers Blog
雷峰网
雷峰网
C
Cybersecurity and Infrastructure Security Agency CISA
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
V
V2EX
宝玉的分享
宝玉的分享
H
Hacker News: Front Page
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
C
Check Point Blog
O
OpenAI News
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
C
CERT Recently Published Vulnerability Notes
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
K
Kaspersky official blog
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary

博客园 - 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. 和存放的物理位置有关,和命名空间无关