program.cs

来自「嵌入式开发从基础到提高」· CS 代码 · 共 36 行

CS
36
字号
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 + =
减小字号Ctrl + -
显示快捷键?