What are the advantages of using inheritance
Goldy Batra 0% found this document useful (0 votes) 5K views 4 pages inheritance Copyright© © All Rights Reserved Available FormatsDOC, PDF, TXT or read online from Scribd Share this documentDid you find this document useful?Is this content inappropriate?Report this Document 0% found this document useful (0 votes) 5K views4 pages Advantages of InheritanceUploaded byGoldy Batra Description:inheritance Full description Inheritance is one of the feature of Object Oriented Programming System(OOPs), it allows the child class to acquire the properties (the data members) and functionality (the member functions) of parent class. What is child class? Syntax of Inheritanceclass parent_class { //Body of parent class }; class child_class : access_modifier parent_class { //Body of child class }; What are the advantages of using inheritance in C++ ProgrammingThe main advantages of inheritance are code reusability and readability. When child class inherits the properties and functionality of parent class, we need not to write the same code again in child class. This makes it easier to reuse the code, makes us write the less code and the code becomes much more readable. Lets take a real life example to understand this: Lets assume that Inheritance ExampleBefore we discuss the types of inheritance, lets take an example:
#include What are advantages and disadvantages of inheritance?Inheritance allows us to inherit all the properties of base class and can access all the functionality of inherited class. It implements reusability of code. DISADVANTAGES: Improper use of inheritance or less knowledge about it may lead to wrong solutions.
What are the advantages of inheritance in Java?Advantages of Inheritance. Re-usability.. Avoiding Duplication of Code.. Extensibility.. Data Hiding.. What are the advantages of using inheritance Mcq?Explanation: Advantage of inheritance are like re-usability- You can re-use existing class in a new class that avoid re-writing same code and efforts. We can make an application easily extensible.
Which is the most important advantage of inheritance?Most important advantages of inheritance are: Reusability - Inheritance allows deriving new classes from existing classes without modifying it. This helps in reusability of information in the child class as well as adding extra functionality in to it.
|