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

随机推荐

  1. oracle 创建同义词

    1.语法: 同义词 (SYNONMY) CREATE SYNONYM同义词名FOR 表名; CREATE SYNONYM同义词名FOR 表名@数据库链接名; Create synonym synony ...

  2. maven仓库介绍

    maven仓库介绍 http://juvenshun.iteye.com/blog/359256

  3. Eclipse设置选中高亮显示(包含debug)

    如果不高亮显示了:工具栏里有个黄色小笔的图标,点一下就可以了,或者alt+shift+O 设置高亮显示:

  4. C++ Code_TabControl

    主题 1. 选项卡控件基础 2. 显示图标的选项卡 3. 选项卡控件高级 4. 5.      属性      选项卡控件基础 1.插入1个对话框,新建1个类 CCDialog1,1 个对话框对应一个 ...

  5. 用Systemtap探索MySQL

    http://www.actionsky.com/docs/archives/168#Systemtap 目录 1 Systemtap 2 Systemtap 观测点的支持程度 2.1 官方编译的My ...

  6. 你所不知到的C++ 系列

    http://blog.csdn.net/doon/article/category/2926337

  7. win7+iss7的配置,以及如何在本地IIS服务器挂载一个网站

    虽然学过在XP安装IIs服务器和在IIS服务器挂载网站的东西,但是win7和XP的方式还是有许多不同的.废话不说直接进入正题 在本地安装IIS服务器 在IIS服务器中添加你的项目 将你项目的首页设置为 ...

  8. Eclipse目录

    1. 解决Ubuntu下的Eclipse打开Windows编写的java代码的中文乱码 2. Eclipse常用快捷键

  9. SVM多分类

    http://www.matlabsky.com/thread-9471-1-1.htmlSVM算法最初是为二值分类问题设计的,当处理多类问题时,就需要构造合适的多类分类器.目前,构造SVM多类分类器 ...

  10. 548 - Tree (UVa OJ)

    Tree You are to determine the value of the leaf node in a given binary tree that is the terminal nod ...