[Solved] How can i Access a private variable in another class in C#
[ad_1] You make members private so that nobody outside the class can access them. This goes inline with the principle of information hiding. Your example should look like this: public class AccessModifiers { // You can only access this inside of the class AccessModifiers private int Abc { get; set; } internal void SetValue(int x){ … Read more