Hello,
I'm coding some C# and cant really get the difference between public and the properties get, set. In me world the two things is kinda the same but my guess is that I have missed something so any help would be nice ty.
Example:
Then from any part of the code I can write:Code:class TheNumber { public int number; public int Number {get; set;} }
so why cant I just have a public member instead of the property one in this case?Code:TheNumber theNumber = new TheNumber(); theNumber.number = 10; theNumber.Number = 10;