Hi all,
What are the advantages of OOP?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 2, 2011, 5:21 AM
1. Data and the methods which operate on it are welded together into objects which enables you to control access to the data and restrict the operations which can be performed on it, a process known as encapsulation. The blueprint for creating objects is the class and a class can also contain shared data or methods which apply to the class as a whole, not to a particular object.
2. Inheritance enables you to reuse code by deriving from an existing class and then adding the new features you need or modifying existing features.
3. Polymorphism enables a group of classes to share some functionality but to implement it in a way which is appropriate for each class. If the classes are related, then polymorphism can be implemented using abstract classes or virtual methods or, if they are unrelated, using interfaces.