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

  • 相关阅读:
    esayui session 超时跳转登录页面
    jQuery easyui dataGrid checkbox反显的值取不到
    SAP中Search help的使用
    ABAP数据表的操作
    ABAP怎样提高代码执行效率?
    实战屏幕SCREEN总结
    SAP窗口基本点
    单选按钮实现alv格式显示和报表下载功能
    JSON字符串转List对象
    XML解析
  • 原文地址:https://www.cnblogs.com/ken-admin/p/5825982.html
Copyright © 2020-2023  润新知