C#-—体验抽象函数

来源:互联网 发布:mysql union result 编辑:程序博客网 时间:2024/06/08 06:58
/*烟台大学计算机学院学生        *All right reserved.        *文件名称:C#-—体验抽象函数*作者:杨飞        *完成日期:2014年10月7日        *版本号:v1.0        *对任务及求解方法的描述部分:C#-—体验抽象函数*我的程序:*/using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication5{    abstract class person    {        public abstract void eat();    }     class student : person    {        public override  void eat()        {            Console.WriteLine("学生在吃饭");                }            }    class Program    {        static void Main(string[] args)        {                                  student s1 = new student();            s1.eat();                       Console.ReadKey();        }    }}

运行结果:

心得体会:感觉无法体会抽象函数的真正的意思啊


0 0