class Program
{
static void Main(string[] args)
{
Adult adult = new Adult();
adult.Drink();
adult.Sleep();
Console.ReadKey();
}
}
public abstract class Person
{
public abstract void Drink();
public void Sleep()
{
Console.WriteLine("人都躺着睡!");
}
}
public class Adult : Person
{
public override void Drink()
{
Console.WriteLine("大人大口大口吃!");
}
}
希望能帮助你理解 |