In C#, is it possible to implement an interface member using a member with a different name, like you can do in VB.NET?

前端 未结 2 1503
南笙
南笙 2021-02-19 11:38

Ok, this is a question I\'m asking, not as in demonstrating good coding practices (this actually could be considered a bad practice) but rather in regards to \'can\' it be done

2条回答
  •  北荒
    北荒 (楼主)
    2021-02-19 11:39

    It "can" be done in the sense that you can achieve a result that's basically indistinguishable from the VB scenario by using explicit implementation + a public method that calls that implementation.

    Aside from cases involving reflection, this really will end up being the same thing.

提交回复
热议问题