+ 1
Hi Kamal, the access modifiers (public, protected, private) determine if you can access an element of a class or struct only in the class it is defined in (private), the class itself and classes that inherit from that class (protected) or from everywhere (public).
The access privileges for class elements are an extent of the auxiliary concept of information hiding that is part of object orientation. The concept of information hiding was devised to prevent the unwanted access and modification of fields in classes or structs. The access modifiers manage who is allowed to use your functions and fields and to prevent unwanted access.