What Is OOPS :
Table of contents
Oops is object-oriented programming.
#WEMAKEDEV
Programming: I think we all are familiar with this word.
Oriented: It revolves around as-
Object: The language that revolves around the object.
So the most important thing about OOPS is the object itself.
What are the benefits of oops
- It will help you to keep your code structured.
- OOPS will help for kotlin code DRY(do not repeat yourself)
DRY
The redundancy to be removed i.e. Repeatness should be removed
LET'S TAKE AN EXAMPLE TO UNDERSTAND
CASE -1
Suppose I am having my lunch, and I know that during my lunch I will need 4 glasses of water then what will I do –
I will come to sit and start my lunch. I feel thirsty, I get up and go get a glass of water and come back. Again I feel thirsty go back and get a glass of water feel come back and eat. repeat this 1,2,3 time.
CASE -2
Whereas my brother, he also has the same habit that he needs 4 glasses of water, he comes and sits to eat but he brings someone like a waterman, So every time he needs a glass of water, he will call the waterman, and the guy has his responsibility to bring a glass of water.
So which one is better Scenario 1&2
So In the first case, there is no system while in the second case is systematic.
So here I appointed one person waterman who brings water for me. So I am not repeatedly doing the same thing. So this is DRY.