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. (剑指Offer)面试题28:字符串的排列

    题目: 输入一个字符串,打印出该字符串中字符的所有排列. 例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba. 思路: 把一个字符串看 ...

  2. jquery validate使用

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  3. SiteMesh学习入门

    http://www.java3z.com/cwbwebhome/article/article2/2962.html?id=1668 demo下载 简介:     sitemesh应用Decorat ...

  4. svn的搭建

    http://www.cnblogs.com/xiaobaihome/archive/2012/03/20/2407610.html

  5. 利用FlashPaper实现类似百度文库功能

    最近需要实现一个类似百度文库的功能,在Google上淘了一段时间,发现FlashPaper还算能够不错的实现此需求. 首先讲下思路: 1>安装FlashPaper: 2>利用java代码将 ...

  6. Hadoop ecosystem

    How did it all start- huge data on the web! Nutch built to crawl this web data Huge data had to save ...

  7. NAT后面的FTP SERVER终极篇

    原文引用:http://blog.chinaunix.net/uid-20592805-id-1918661.html   如果对于被动模式还有不同的意见,我们可以再看下这篇文章: http://ww ...

  8. 标准C++中的STL容器类简单介绍

    SGI -- Silicon Graphics[Computer System] Inc.硅图[计算机系统]公司. STL -- Standard Template Library 标准模板库.   ...

  9. linux C 9*9

    #include<stdio.h> #include<conio.h> #include <windows.h> void Gotoxy(int x, int y) ...

  10. 关于对defer的理解.

    代码 <script defer> function init(){ document.getElementById("div").innerHTML="OK ...