Rabu, 12 Oktober 2016

What are the advantages and disadvantages of inheritance

Advantages of inheritance are as follows: Inheritance promotes reusability. When a class inherits or derives another class, it can access all the functionality of inherited class. Reusability enhanced reliability. The base class code will be already tested and debugged. As the existing code is reused, it leads to less development and maintenance costs. Inheritance makes the sub classes follow a standard interface. Inheritance helps to reduce code redundancy and supports code extensibility. Inheritance facilitates creation of class libraries.   Disadvantages of inheritance are as follows: Inherited functions work slower than normal function as there is indirection. Improper use of inheritance

The post What are the advantages and disadvantages of inheritance appeared first on Coding Security.


What are the advantages and disadvantages of inheritance
read more

Tidak ada komentar:

Posting Komentar