c#关键字和常用类型表快查

类型字节取值范围说明
bool1true/false/null布尔类型
char20x0000~0xffffUnicode 16 位字符
byte10~255无符号的 8 位整数
sbyte1-128 到 1278 位带符号整数
short2-32,768 到 32,767有符号 16 位整数
ushort
20~65535无符号 16 位整数
int4-2,147,483,648 到 2,147,483,647带符号的 32 位整数
uint40 到 4,294,967,295无符号的 32 位整数,后缀 U 或 u
long8–9,223,372,036,854,775,808 到 9,223,372,036,854,775,80764 位带符号整数,后缀 L
ulong80 到 18,446,744,073,709,551,615无符号 64 位整数,后缀 UL 或 ul
decimal16(-7.9*10^28 - 7.9*10^28)/(100^-28)128 位数据类型,精度28-29位,后缀 m 或 M
double8±5.0*10^−324 到 ±1.7*10^30864 位浮点值,精度15-16位,后缀 d 或 D
float4-3.4*10^38 到 +3.4*10^3832 位浮点值,精度7位,后缀 f 或 F

 

 

 

 

 

 

 

 

 

 

 

 

 

(*)泛型修饰符

关键字
asbaseboolnamespacenewnull对象
breakbytecasecatchoperatoroutout(*)替代
charcheckedconstparams专用受保护公用
continue小数default委托只读refreturnsbyte
dodoubleelseenumsealedshortsizeofstackalloc
事件explicitexternFALSEstatic字符串structswitch
finallyfixedfloatforthisthrowTRUEtry
foreachgotoifimplicittypeofuintulongunchecked
inin(*)int接口unsafeushortusingusing static
内部islocklongvoidvolatilewhile 

 

 

 

 

 

 

 

 

 

 

 

类型修饰符语句命名空间运算符上下文关键字查询
bool访问修饰符选择语句namespaceasadd
byte可访问性级别if-elseusingawaitgetwhere 子句
char可访问域switchusing 指令isglobalselect 子句
小数访问性级别限制迭代语句using staticnew分部(类型)group 子句
双精度内部dousing 语句new 运算符分部(方法)into
enum专用for外部别名new 修饰符removeorderby 子句
float受保护foreach...in new 约束setjoin 子句
int公用while转换关键字sizeofwhen(筛选条件)let 子句
longabstract跳转语句explicittypeofwhere(泛型类型约束)ascending
sbyteasyncbreakimplicitTRUEdescending
shortconstcontinueoperatortrue 运算符yieldon
struct事件goto true 字面常数 equals
uintexternreturn访问关键字FALSE内置类型表by
ulongin(*)异常处理语句basefalse 运算符整型表in
ushortout(*)throwthisfalse 字面常数浮点型表 
替代try-catch stackalloc默认值表 
委托只读try-finally文本关键字nameof值类型表 
动态sealedtry-catch-finallynull 隐式数值转换表 
接口staticChecked and Uncheckeddefault 显式数值转换表 
对象unsafechecked  设置数值结果表的格式 
字符串virtualunchecked  修饰符 
voidvolatilefixed 语句    
var lock 语句    

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

*枚举关键字enum的默认类型为int,若需要其它类型,自行限定:public enum Option : byte { UnKnow,Normal,Low,High }

 

转载于:https://www.cnblogs.com/xiii/p/7061960.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值