Alternate way of getting and settig properties in C#?

Rajesh_Kumar
Posted by Rajesh_Kumar under C# category on | Points: 40 | Views : 1347
C# 3.0 comes with Automatic properties initialization ,in which we do not have to write properties for variables.
Just write:

public class Person
{
public Person()
{
}

public string FirstName { get; set; }
public string LastName { get; set; }
}
Note:Setting and Getting value are the same.

Comments or Responses

Login to post response