Which of the following statements is correct about a class and an object in C++?

Asked In: BPSC TRE 1.0

Options

  • A. An object is an instance of its class.
  • B. A class is an instance of its object.
  • C. An object is the blueprint used to create a class.
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. An object is an instance of its class.

Detailed Explanation

Correct Answer: Option A

Explanation:
A class is a blueprint that defines data members and member functions. An object is an instance of that class. For example, Car can be a class, and myCar can be an object of that class.