inherit

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace
{
class Program
{ static void Main(string[] args)
{ goHomeByTrain bytrain = new goHomeByTrain(); bytrain.sele(); }
} public class goHomeByTrain : selebreate
{
protected override void GoHomeBy()
{
Console.WriteLine("go home by train!");
} } public abstract class selebreate
{
public void sele()
{
BookTicket();
GoHomeBy();
SelebreateFe();
} protected virtual void GoHomeBy()
{
Console.WriteLine("go home by ...");
}
protected void SelebreateFe()
{
Console.WriteLine("selebreate Spring Festival ");
}
protected void BookTicket()
{
Console.WriteLine ("Book ticket!");
} }
}
上一篇:中国防静电气泡袋膜行业需求趋势及投资潜力预测分析报告2022-2027年


下一篇:2021-2027全球与中国电动汽车增程器市场现状及未来发展趋势