We cannot access a private variable of a class from an object, which is created outside the class, but it is possible to access when the same object is created inside the cl
why??
It's true by the language specification. The access modifier private has the semantics that only the class or struct declaring a member is allowed to access that member.
I suggest reading the specification for details. In particular, check out
§3.5.1 Declared Accessibility
§3.5.4 Accessibility constraints
§10.2.3 Access Modifiers
§10.2.6.2 Declared Accessibility
§10.2.6.5 Access to private and protected members of the containing type