zoukankan      html  css  js  c++  java
  • Person

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace PersonDemo2
    {
        /// <summary>
        /// 性别
        /// </summary>
        public enum Gender
        {
            Female,Man
        }

       public class Person
       {
           #region 
           protected string name;
           private Gender gender;
           private string hobby;
           protected int age;
           #endregion

           public Person()
           {
           }

           public string Name
           {
               get { return name; }
               set { name = value; }
           }
           public Gender Gender
           {
               get { return gender; }
               set { gender = value; }
           }
           public string Hobby
           {
               get { return hobby; }
               set { hobby = value; }
           }

           public virtual void Speak(string msg)
           {
               Console.WriteLine(name+"说"+msg);
           }

           public void ShowInfo()
           {
               Console.WriteLine("{0} {1} {2} {3}",name,gender,hobby,age);
           }

           public virtual void Study()
           {
               Console.WriteLine("so bad!");
           }
       }
    }

  • 相关阅读:
    python --异常处理
    Python -- 函数对象
    python --循环对象
    python --循环设计
    python --模块
    python --文本文件的输入输出
    xpee.vbs
    oracle 有个xe版本
    POI对Excel单元格进行颜色设置
    POI进行ExcelSheet的拷贝
  • 原文地址:https://www.cnblogs.com/ken-admin/p/5825982.html
Copyright © 2011-2022 走看看