码迷,mamicode.com
首页 > Windows程序 > 详细

C# 总是在set处抛出 system stack over flow exception的异常是什么原因

时间:2017-05-18 11:46:23      阅读:375      评论:0      收藏:0      [点我收藏+]

标签:space   oid   cep   system   ram   read   ati   []   turn   

namespace ConsoleApp1

{

   

    class Program

    {

        static void Main(string[] args)

        {

            People tom = new People() ;

            tom.Name =" Tom";

            tom.Age = 18;

            tom.MyPlace = Console.ReadLine();

            Console.WriteLine(tom.MyPlace);

            Console.ReadKey();

         }

    }

public class People

    {

        public string Name;

        public int Age;

        public string MyPlace

        {

            get

            {

                return MyPlace;

            }

            set

            {

                if (value == "北京")

                {

                    MyPlace = value;

                }

                else

                {

                    MyPlace = "不符合要求";

                }

            }

        }

}

}

C# 总是在set处抛出 system stack over flow exception的异常是什么原因

标签:space   oid   cep   system   ram   read   ati   []   turn   

原文地址:http://www.cnblogs.com/lovelykitty/p/6871814.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!