Program paradigms:
What is paradigm - conceptualize and structure the implementation.
Types of program paradigms:
Imperative – code directly controls execution flow and state change, explicit statements that change a program state
Declarative –
Concurrent programming –
Constraint programming –
Dataflow programming –
Distributed programming –
so on...
Source: https://en.wikipedia.org/wiki/Programming_paradigm
*** Let us discuss about OOPs Concepts from Imperative paradigm ***
What is Object and Class?
Class is like a blueprint or our imagination of how something should be.
Object is like the physical entity that exists in real life.
A class can exist without an object, but an object cannot exist without a class.
Real time Reference:
Alright, let's make it even simpler:
Class is like a recipe. It tells you how to make something.
Object is the thing you actually make from that recipe.
For example:
Class: The recipe for making a cake.
Object: The actual cake you baked.
You can have many cakes (objects) from one recipe (class), but you can’t have a cake without a recipe!
Top comments (0)