您的位置:首页 > 编程语言 > C#

C#抽象类

2015-09-09 10:14 337 查看
using System;using System.Collections.Generic;using System.Linq;using System.Text;//抽象类的一个实例namespace Abstruct{ abstract class Abclass { public void IdentifyBase() { Console.WriteLine("I am AbClass!"); } abstract public void IdentifyDerived(); } class DerivedClass :Abclass { override public void IdentifyDerived() { Console.WriteLine("I Am DerivedClass"); } } class Program { static void Main(string[] args) { DerivedClass dc = new DerivedClass(); dc.IdentifyBase(); dc.IdentifyDerived(); Console.ReadKey(); } }}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: