What is the meaning of “this” in C#

前端 未结 8 1266
猫巷女王i
猫巷女王i 2020-12-07 01:44

Could anyone please explain the meaning \"this\" in C#?

Such as:

// complex.cs
using System;

public struct Complex 
{
   public int real;
   public          


        
8条回答
  •  失恋的感觉
    2020-12-07 02:21

    The this keyword refers to the current instance of the class and is also used as a modifier of the first parameter of an extension method.

    enter image description here

    this (C# reference) - MSDN
    C# Keywords - MSDN

提交回复
热议问题