0
Объсните, пожалуйста, как работает public и privat в C#?
1 Odpowiedź
+ 2
You can find a complete explanation in the language reference.
https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers
Generally public means it is accessible from anywhere, including from other classes and even from other programs. Private can only be accessed within the same class or struct. There are also some other access levels inbetween (protected, internal...).