C#最简单例子

using System;

namespace ConsoleApplication1
{
    class People
    {
        int age;
        string name;
        public string getname()
        {
            name = "xiaofang";
            return name;
        }
        public int getage()
        {
            age = 152;
            return age;
        }
    
    }
    class Program
    {
        static void Main(string[] args)
        {
            People men = new People();
            Console.WriteLine(men.getname());
            Console.Write(men.getname());
            Console.Read();
        }
    }
}

 

posted @ 2015-10-27 11:25  海蓝7  阅读(649)  评论(0编辑  收藏  举报