| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp2
- {
- class Animal
- {
- public virtual void sound()
- {
- Console.WriteLine("make a sound.....");
- }
- }
- class Dog : Animal
- {
- public override void sound()
- {
- base.sound();
- Console.WriteLine("wangwangwang......");
- }
- }
- interface sound
- {
- void makeSound();
- }
- interface eat
- {
- void food();
- }
- class Cat : sound,eat
- {
- public void makeSound()
- {
- Console.WriteLine("miaomiaomiao.....");
- }
- public void food()
- {
- Console.WriteLine("eat cat food...");
- }
- }
- }
|