Interface implementation in C# and VB.NET

后端 未结 3 1785
青春惊慌失措
青春惊慌失措 2020-12-21 23:21

I have an interface defined in C# project:

public interface IForm
{
    bool IsDisposed { get; }
    void Show();
}

I implemen

3条回答
  •  余生分开走
    2020-12-22 00:02

    VB does not have implicit interface implementation, only explicit while C# supports both.

    This means that you have to explicitly say exactly what member that implements an interface member. This adds some flexibility, for example you can make the method that implements an interface member private or protected and you can give it a name that differs from the interface member.

    You can read more about the details of this here: http://ondevelopment.blogspot.se/2008/10/implementing-interfaces-in-vbnet.html

提交回复
热议问题