为什么一定要在基类接口之前声明一个派生类时,可以指定? [英] Why must the base class be specified before interfaces when declaring a derived class?

查看:148
本文介绍了为什么一定要在基类接口之前声明一个派生类时,可以指定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public interface ITest
{
    int ChildCount { get; set; }
}

public class Test
{
}

public class OrderPool : ITest, Test
{
    public int ChildCount
    {
        get;
        set;
    }
}

错误说Base类测试必须来自任何接口之前。 为什么有必要先扩展类,然后实现inteface?

The error says Base class 'Test' must come before any interfaces. Why is it necessary to extend the class first and then implement the inteface?

推荐答案

由于的规范是这么说的第§17.1.2

这篇关于为什么一定要在基类接口之前声明一个派生类时,可以指定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆