Declarations vs definitions

后端 未结 6 2310
名媛妹妹
名媛妹妹 2021-02-19 18:10

In C# how does a declaration differ from a definition, i.e.:

  1. A class declaration vs a class definition
  2. A variable declaration vs definition
  3. A met
6条回答
  •  天涯浪人
    2021-02-19 18:41

    Answers to original questions 1, 2, 3: no difference in C#

    However might be worth mentioning those terms in regards to methods:

    • Declaration is place in Interface where we just "declare" the signature of the method
    • Definition is the actual place where we "define" the actual implementation of the declared previously method. (same as "implementation")

提交回复
热议问题