Explain the advantages of inheritance.



Explain the advantages of inheritance...

Answer / Peer Golden Hansda

1. Code Reusability: Inheritance allows developers to reuse code written for a parent class in child classes, reducing the amount of time and effort required to develop similar functionality for multiple classes.
2. Improved Modularity: By organizing code into base classes and derived classes, inheritance makes it easier to create modular programs that are easier to maintain and debug.
3. Polymorphism: Inheritance enables polymorphism, allowing objects of different classes to be treated as if they were instances of a common superclass.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

which is platform independent device used in computers

2 Answers  


What is Iteration Hierarchy? What is what is Object behavioral concept?

1 Answers  


What is encapsulation in oop?

1 Answers  


What is the benefit of oop?

1 Answers  


What is namespace?

15 Answers  


You have one base class virtual function how will call that function from derived class?

4 Answers  


Is enum a class?

1 Answers  


suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?

3 Answers   EA Electronic Arts,


Program to open a file with First argument

1 Answers   TCS,


What is abstraction encapsulation?

1 Answers  


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

0 Answers  


What is encapsulation in simple terms?

1 Answers  


Categories