What is the relation between object and class in an object-oriented programming?

2021

What is the relation between object and class in an object-oriented programming?

Answer: C. Object is instance of classIn Object-Oriented Programming (OOP), a class is a blueprint or template that defines properties and behaviors. An object is a real entity created from that…

  1. A.

    Object is keyword of class

  2. B.

    Object is scope of class

  3. C.

    Object is instance of class

  4. D.

    Object is type of class

Attempted by 790 students.

Show answer & explanation

Correct answer: C

In Object-Oriented Programming (OOP), a class is a blueprint or template that defines properties and behaviors. An object is a real entity created from that class.

Therefore, an object is called an instance of a class.

Example:

class Car { };
Car c1;

Here, Car is a class and c1 is its object (instance).

Explore the full course: Dsssb Tgt Computer Science Paper 2

Loading lesson…