person.cs

来自「东软内部材料(四)asp等相关的教学案例 」· CS 代码 · 共 40 行

CS
40
字号
namespace People
{
	///<remarks>
	///The <c>person</c>class defines the salient
	///attributes of every person
	///</remarks>

	public class Person
	{
		private string _firstName;
		private string _lastName;

		///<summary>Default constructor</summary>
		public Person() {}

		///<summary>Constructor using first and last names</summary>
		///<param name="firstName">The first name of the programmer</param>
		///<param name="lastName">The last name of the programmer</param>
		///<seealso cref="string"/>
		public Person(string firstName, string lastName)
		{
			_firstName = firstName;
			_lastName = lastName;
		}

	    ///<value>Defines the first name of the person.</value>
		public string FirstName
		{
			get {return _firstName;}
			set {_firstName = value;}
		}

	    ///<value>Defines the last name of the person.</value>
		public string LastName
		{
			get {return _lastName;}
			set {_lastName = value;}
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?