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!");
           }
       }
    }

  • 相关阅读:
    如何快速方便的输出向量vector容器中不重复的内容
    System.IO.FileInfo.cs
    System.IO.FileSystemInfo.cs
    System.IO.FileAttributes.cs
    System.IO.StreamWriter.cs
    System.IO.TextWriter.cs
    System.IO.StreamReader.cs
    System.IO.FileStream.cs
    System.IO.FileOptions.cs
    System.IO.FileShare.cs
  • 原文地址:https://www.cnblogs.com/ken-admin/p/5825982.html
Copyright © 2011-2022 走看看