Main advantage of Oops | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Main advantage of Oops

Hi I want to know that why object oriented programming is used nearly everywhere and also what is the advantages of using it

18th Apr 2019, 4:15 AM
Nitin Tiwari
Nitin Tiwari - avatar
3 Answers
+ 1
if you have group of (different) objects inherited from one class and all of this objects need new feature, you don't have to rewrite them all, just change their class. If you need new similar object, you don't have to programming it from zero, or copy a long code multiple times and maintenance separately, just inherit similar class. Data for object (like variables) and methods that use them are grouped together, it is useful in big project, where there can be same names for variables/ methods in different contexts, and it is in overview. Parts of functional code are independently and easy usable again in other codes. Disadvantages are little higher memory and performance demands.
18th Apr 2019, 6:16 AM
zemiak
+ 2
Thanks
18th Apr 2019, 6:34 AM
Nitin Tiwari
Nitin Tiwari - avatar
0
write acod for a user defined function which calculates the prod uct of four variable
5th May 2019, 7:41 PM
ali ali
ali ali - avatar