this关键字
在 C# 中,可以使用 this 关键字来表示当前对象,日常开发中我们可以使用 this 关键字来访问类中的成员属性以及函数。
使用this表示当前类的对象

执行结果

使用 this 关键字串联构造函数

执行结果

使用 this 关键字作为类的索引器

执行结果

使用 this 关键字作为原始类型的扩展方法

执行结果

在 C# 中,可以使用 this 关键字来表示当前对象,日常开发中我们可以使用 this 关键字来访问类中的成员属性以及函数。
执行结果
执行结果
执行结果
执行结果