Following is a question regarding using properties in class.
I have been using public properties instead of exposing member variables publically. Majority advise that this approach helps encapsulation. However, I don’t understand the encapsulation advantage by making it a property.
many people donot know the real reason for using properties. They just do it as part of coding standard.
Can someone clearly explain how a property is better than public member variable and how it improves encapsulation?