Access Class Members using Object

The private data of a class can be accessed only through the member functions of that class. The main() function cannot contains statements that the access class members directly. Private members of the class can only accessed by the members with in that class. Public members of the class can be accessed outside the class also. To access class member outside class, it can be done by using dot operator and object of that class. Syntax: Example:

Read More