且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

A.4.1-类的继承(implement)

更新时间:2022-09-24 09:46:41

ylbtech- .NET-Basic: A.4.1-类的继承(implement)

 A.4.1-类的继承(implement)

1.A,源代码返回顶部
A.4.1,Person.cs
A.4.1-类的继承(implement)View Code
A.4.2,Student.cs
A.4.1-类的继承(implement)View Code
A.4.3,Teacher.cs
A.4.1-类的继承(implement)View Code
A.4.0,Program.cs
A.4.1-类的继承(implement)
using System;

namespace 继承
{
    class Program
    {
        static void Main(string[] args)
        {

            //实例化对象
            
            //多行注释/*  */
            /*
            //1
            Person p = new Person();

            p.Show();
             */
            
            /*
            //2
            Person p = new Person(2000, "yuanbo", "男");

            p.Show();
             * */

            /*
            //3
            Student s = new Student();

            s.Show();
             * */
            /*
            //4
            Student s = new Student(2000, "mike", "男", "3期");
            s.Show();
             * */

            Console.ReadLine();
        }
    }
}
A.4.1-类的继承(implement)

本文转自ylbtech博客园博客,原文链接:http://www.cnblogs.com/ylbtech/archive/2013/03/25/2980883.html,如需转载请自行联系原作者