⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 program.cs

📁 嵌入式开发从基础到提高
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;

namespace 重载构造函数
{
/************************
* 程序描述:重载构造函数
* 创 建 人:ncbcy@eiTarget
* 版 本 号:1.0.0
* 修改记录:0
***********************/
    class Program
    {
        static void Main(string[] args)
        {
            PersonInfo P003 = new PersonInfo("陈");
            PersonInfo P004 = new PersonInfo(true);
            PersonInfo P005 = new PersonInfo(005);
            Console.WriteLine(P003.pid + "\t" + P003.pname + "\t" + P003.psex);
            Console.WriteLine(P004.pid + "\t" + P004.pname + "\t" + P004.psex);
            Console.WriteLine(P005.pid + "\t" + P005.pname + "\t" + P005.psex);
            Console.ReadLine();
        }
    }
    class PersonInfo
    {
        public int pid;
        public string pname;
        public bool psex;
        public PersonInfo(string pname) { this.pname = pname; }
        public PersonInfo(int pid) { this.pid = pid; }
        public PersonInfo(bool psex) { this.psex = psex; }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -