[Solved] Properties in C# advantage [duplicate]


From personal experience:

You would generally have Private data member when you do not want it to be accessed externally through another class that calls the class containing the Private data member.

Public data members are those that you can access by other classes to obtain its contents.

My opinion is that it is simply proper programming syntax. Private data members are typically those of constants that you do not wish to override once it had been set, while Public are algebraic-like variables, subject to be overridden if necessary.

A similar question has been asked at:
What is the difference between Public, Private, Protected, and Nothing?.

Cheers,

iato

1

solved Properties in C# advantage [duplicate]