C# 7.0 in a Nutshell读书笔记一(关键字)
一、关键字(不能直接作为标识符使用)
类相关:class base new (其他修饰符) abstract virtual override delegate sealed extern void readonly(定义只读字段)static
在switch语句或泛型代码中使用:default
接口:interface
数据类型: int uint long ulong short ushort decimal double float true false bool char string byte sbyte enum struct object null
常量定义:const
对整型算术运算和转换显式启用溢出检查:checked unchecked
操作符:as operator explicit Implicit
条件:if else goto case break continue switch
循环:for foreach in while do
程序集:namspace using
修饰符:(访问修饰符)public internal private
异常捕捉:try catch finally throw
其他:fixed unsafe event(事件) out(输出变量定义) params(参数) typeof(获取类型) lock ref return sizeof stackalloc(表达式在堆栈上分配内存块)
上下文关键字(可以用于作为标识符)
add dynamic in orderby var ascending desending equals into
partial when async await from join remove where await
get set let select yield by group on value global nameof
本文来自博客园,作者:CelonY,转载请注明原文链接:https://www.cnblogs.com/CelonY/p/12902659.html