Why are parameter names necessary in an interface definition? I am allowed to choose new parameter names during implementation

后端 未结 6 1833
粉色の甜心
粉色の甜心 2020-12-11 00:16

Not sure if this is a silly question, but I just noticed this:

public interface IActivityDao : IDao
{
    IList GetAllSinceSe         


        
6条回答
  •  旧时难觅i
    2020-12-11 01:04

    Parameter names are required in an interface declaration for clarity of implementation and for reference. If someone were using your interface, the names of the method parameters are meant to be self documenting so the consumer of the interface understands what to pass to the method (eg when viewing the method description via IntelliSense)

    And yes, when you implement the interface you can name the parameters whatever you want.

提交回复
热议问题