sailing

Everything...

从一个constructor里调用另外一个constructor

    class Person

    {

        public Person(string firstName, string lastName)

            :this(firstName,lastName,0)

        {

        }

 

        public Person(string firstName, string lastName, int age)

        {

            m_firstName = firstName;

            m_lastName = lastName;

            m_age = age;

        }

 

        private string m_firstName;

        private string m_lastName;

        private int m_age;

    }

posted on 2007-03-06 10:46  乌生鱼汤  阅读(208)  评论(0编辑  收藏  举报

导航