Possible Duplicate:
C#: Public Fields versus Automatic Properties
just basic question here. I fail to understand the need or the difference between automatic properties VS regular local variable
Class abc {
//automatic properties
Public int serial_number { get; set;}
//Regular local variable
Public int serial_number2;
}
I know mostly we use automatic properties for constructor initial value. But we can do the same thing with local variable Can anyone explain this to me? Pros vs cons?
Thanks