C#クラス(9)Thisキーワード


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;



namespace ConsoleApplication1

{

    // .

    class MyClass

    {

        string MyString = "Tony";

        public void ShowMessage(string MyString)

        {

            if (MyString == this.MyString)  //  MyString MyString,  this.MyString .  ,this .

            { Console.WriteLine(" "); }

            else

            { Console.WriteLine(" "); }

        }

    }



    class Program

    {

        static void Main(string[] args)

        {

            MyClass My = new MyClass();

            My.ShowMessage(Console.ReadLine());

        }

    }

}