Which term is used to describe the blueprint for creating objects?

202420242024

Which term is used to describe the blueprint for creating objects?

  1. A.

    Class

  2. B.

    Interface

  3. C.

    Method

  4. D.

    Variable

Attempted by 5 students.

Show answer & explanation

Correct answer: A

In Object-Oriented Programming (OOP), every object is created from an underlying construct that defines the properties (attributes or fields) it will hold and the behaviors (methods) it can perform. This construct acts as the blueprint or template from which individual objects are instantiated, and is distinct from a mere contract of method signatures, a single behavior, or a single stored value.

The term used for this blueprint construct is Class — a class defines the complete structure and behavior template from which objects are created, so the term being asked for is Class.

Contrasting with the other options:

  • Interface: only declares a contract of method signatures that an implementing class must provide; it carries no data structure or state of its own, so it cannot serve as the blueprint from which an object is created.

  • Method: represents a single action or behavior that an already-existing object can perform; it does not define the object's overall structure.

  • Variable: holds a single data value or reference at runtime; it defines neither structure nor behavior.

Explore the full course: Hexaware Preparation