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

📄 dog.cs

📁 大话设计模式源码bigtalkdesignpattern_src
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;

namespace 动物练习
{
    class Dog
    {
        private string name = "";
        public Dog(string name)
        {
            this.name = name;
        }

        public Dog()
        {
            this.name = "无名";
        }

        private int shoutNum = 3;
        public int ShoutNum
        {
            get
            {
                return shoutNum;
            }
            set
            {
                shoutNum = value;
            }
        }

        public string Shout()
        {
            string result = "";
            for (int i = 0; i < shoutNum; i++)
            {
                result += "汪 ";
            }
            return "我的名字叫" + name + " " + result;
        }
    }

}

⌨️ 快捷键说明

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