How Class members are Accessing in program ?

Accessing Class members  as below:
  • Private data of a class can be accessed only through the member functions of the that class . 
  • The format for calling a member function is 
object name. function name (parameters)
  • For example the function call statement could be 
x.getdata(10,10.5);
x.putdata();
  • Objects can communicate by sending and receiving messages. 
  • x.putdata() sends a message to the object x requesting it to display its contents.

Post a Comment

Previous Post Next Post