简体   繁体   中英

Declare all Methods of inherited interface within interface?

Do you need to redeclare all methods declared in the inherited interface in a derived interface?

Example:

public interface IBoo
{
    void DoSomething();
}

public interface IFoo : IBoo
{
    string SayHello();
}

Or would I have to do this:-

public interface IFoo : IBoo
{
    void DoSomething();

    string SayHello();
}

Do you need to redeclare all methods declared in the inherited interface in your interface?

No. Actually this is the concept of inheritance. All the methods that are declared in the base interface will be inherited to the derived.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM