using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; namespace 课本习题
{
public class Animal
{
public Animal()
{
Console.WriteLine("基类构造函数:Hello,Animal");
}
public void Eat()
{
Console .WriteLine("扩充类方法:Eating");
}
}
public class Cat:Animal
{
public Cat()
{
Console.WriteLine("扩充类构造函数:Hello,Cat");
}
public void Walk()
{
Console .WriteLine("扩充类方法:Walking");
}
}
class Program
{
static void Main(string[] args)
{
Cat cat=new Cat ();
cat.Eat();
cat.Walk();
Console .ReadLine();
}
}
}