当前位置:网站首页>C # define and implement interface interface

C # define and implement interface interface

2022-06-22 14:28:00 Cangwolf King unity College

1、 Defining interfaces

 interface IA
    {
        void Method1();
    }
 interface IB:IA
    {
        void Method2();
    }

 interface IFly
    {
        void Fly();
        void MethodA();
    }

2、 Implementation interface

class Bird :IFly,IB{
        public void Fly()
        {
            
        }

        public void MethodA()
        {
            
        }

        public void Method1()
        {
            
        }

        public void Method2()
        {
            
        }
    }

原网站

版权声明
本文为[Cangwolf King unity College]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221304023844.html