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

📄 program.cs

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

namespace 构造函数_this
{
/************************
* 程序描述:构造函数的实例,构造函数中使用this关键字引导与形参同名的类数据成员。
* 创 建 人:ncbcy@eiTarget
* 版 本 号:1.0.0
* 修改记录:0
***********************/
    class Program
    {
        static void Main(string[] args)
        {
            PersonInfo P002 = new PersonInfo(002, "男", 168);
            Console.WriteLine(P002.pid + "\t" + P002.sex + "\t" + P002.tall);
            Console.ReadLine();
        }
    }
    class PersonInfo
    {
        public int pid;
        public string sex;
        public int tall;
        public PersonInfo(int pid, string sex, int tall)
        {
            this.pid = pid;
            this.sex = sex;
            this.tall = tall;
        }
    }
}

⌨️ 快捷键说明

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