The internal workings of a class should be hidden from the outer world, according to object-oriented programming concepts. When you disclose a field, you're essentially revealing the class's internal implementation. As a result, we wrap fields in Properties (or methods in Java) so that we can modify the implementation without disrupting code that depends on us. Because we can put logic in the Property, we can also do validation logic and other tasks if necessary. Autoproperties are a somewhat perplexing concept in C# 3. This allows us to define the Property and have the C#3 compiler create the private field for us.
public class Person
{
private string _name;
public string Name
{
get
{
return _name;
}
set
{
_name = value;
}
}
public int Age{get;set;} //AutoProperty generates private field for us
}