5.5 SOME SHORT QUESTIONS AND ANSWERS I

Q. What is an object?

A. In simple words, an object is an instantiation of a class.

Q. What is a class?

A. Prima-facie Class is a user-defined type like structure. In addition to data members, it also contains declaration of all the functions that operate on this type.

Q. What are the components of a class?

A. A class consists of two components, data members and methods.

Q. What are data members?

A. Data members are variables of any type (inbuilt or user defined.)

Q. What are methods?

A. Methods are functions associated with the class. They are able to access even private data members.

Q. How to create a class definition?

A. We study the real life object and its attributes are made as the data members of ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.