+ 2
Is private encapsulation used by default?
I have wrote the "private" keyword for the class, where I have Main function, and compiler returned me an error. Why? As I remembered, when is no one encapsulation keywords is used, a class or method is automatically private.
2 Réponses
+ 6
default access modifier is private for class members not for the class , I have read lots of texts about c# and "as I understood" is internal
+ 2
firstly, access modifier is for the class members. it is used to eradicate the data clash between different classes. thereby, private and protected members of different class can have same name as they are not accessible for outside. secondly, a member in the class is by default private not the class. THINK SIMPLY : if a class is private, it will be inaccessible from any part of the program. there is no concept like private class.thank u