C PROGRAMMING
MULTIPLE CHOICE QUESTION
OLD QUESTION BANK
SAMPLE QUESTION 2080 AND SOLUTION

Definitions of Class, Method and Object in OOP

Class:

Definition: A class is a blueprint or template for creating objects in OOP. It defines the properties (attributes or fields) and behaviors (methods or functions) that objects of that class will have.

Example: If you consider a class Car, it may have attributes like color, make, model, and methods like start(), stop(), accelerate(), and brake().

Method:

Definition: In OOP, a method is a function or procedure defined within a class. It represents the behavior or actions that objects of that class can perform.

Example: In the Car class mentioned earlier, methods like start() and stop() represent actions that a car object can perform.

Object:

Definition: An object is an instance of a class. It represents a specific entity or instance of data defined by the class, possessing its own state (attributes) and behavior (methods).

Example: If you create an object my_car from the Car class, it would have its own set of attributes (e.g., color, make, model) and methods (e.g., start(), stop()) that define its specific characteristics and behavior.