What is Method, Property and Function?

后端 未结 6 1345
失恋的感觉
失恋的感觉 2021-01-02 08:48

Yeah, I\'m struggling with that. I cannot distinguish among them because every explanation I read is so unclear and philosophical enough. Can someone clear up these definiti

6条回答
  •  有刺的猬
    2021-01-02 09:23

    Field - A field is a variable of any type that is declared directly in a class or struct. Fields are members of their containing type.

    Property - A property is a member that provides a flexible mechanism to read, write, or compute the value of a private field.

    Method - A method is a code block containing a series of statements. In C#, every executed instruction is done so in the context of a method.

    Procedure - A procedure is a code block containing a series of statements.

    Function - A function is a code block containing a series of statements. That return operation result.

提交回复
热议问题