C# 历史版本

从2002年的C#1.0到2022年的C#11.0,C#语言经历了多次重大更新,引入了如泛型、LINQ、异步编程、记录类型等众多特性。本文概述了C#每个主要版本的关键特性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

C# 1.0 [2002年01月]

类、结构、接口、事件、属性、委托,运算符和表达式、语句、特性

C# 2.0 [2005年11月]

泛型、Partial 类型、匿名方法、迭代器、可空类型、私有 setters、方法组转化(delegates)、协变和逆变、静态类

C# 3.0 [2007年11月]

隐式类型的局部变量(var)、对象与集合初始化器、自动实现属性(get;set;)、Partial 方法、匿名类、扩展方法、LINQ、Lambda 表达式、表达式树

Overview of C# 3.0 | Microsoft Learn

C# 4.0 [2010年04月]

动态绑定(dynamic)、命名参数和可选参数、泛型协变和逆变、嵌入式互操作类型

C# 4.0 - New C# Features in the .NET Framework 4 | Microsoft Learn

C# 5.0 [2012年08月]

异步特性(async & await)、调用者信息

An Introduction to New Features in C# 5.0 | Microsoft Learn

C# 6.0 [2015年07月]

表达式为主体的成员方法和只读属性、属性初始化赋值、nameof 表达式、Await in catch block、异常过滤器(when)、字符串插值

The history of C# - C# Guide | Microsoft Learn

C# 7.0 [2017年03月]

out variables、Tuples、Discards、Pattern Matching、局部方法、Generalized async return types

The history of C# - C# Guide | Microsoft Learn

C# 8.0 [2019年04月]

Readonly members、默认接口方法、Using declarations、静态局部方法、Disposable ref structs、可空引用类型

The history of C# - C# Guide | Microsoft Learn

C# 9.0 [2020年09月]

Records、Init-only properties、Top-level statements、Init accessors and readonly fields、With 表达式、Value-based equality、Primary constructor

What's new in C# 9.0 - C# Guide | Microsoft Learn

C# 10.0 [2021年11月]

Record structs、Global using directives、File-scoped namespace declaration、Extended Proptery Patterns、Null Parameter Checking、Constant interpolated strings

What's new in C# 10 - C# Guide | Microsoft Learn

C# 11.0 [2022年11月]

原生字符串字面量、Generic math support、泛型 attributes、UTF-8 字符串字面量、Newlines in string interpolation expressions、List patterns、file类型修饰符、Required members、Auto-default structs、Pattern match Span<char> on a constant string、Extended nameof scope、Numeric IntPtr、ref fields and scoped ref、Improved method group conversion to delegate、Warning wave 7 

What's new in C# 11 - C# Guide | Microsoft Learn

综合

The history of C# - C# Guide | Microsoft Learn

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值