Posts

Showing posts from May, 2022

Comparing Inheritance and Polymorphism

  Comparing Inheritance & Polymorphism   In Object-oriented programming, polymorphism and inheritance are both fundamental concepts. The addition of objects in modern programming languages has made a significant difference in how we use the language and what we can do with it. In short , object-oriented programming is a set of  strategies that allows programmers to use categories and thus derive objects supported by these classes. It aims to fit real-world entities and make it easier for programmers to write code that is inclusive of the paradigm in which they are writing code. There are four basic Object-oriented programming concepts: inheritance, abstraction, polymorphism, and encapsulation. As previously stated, each of the ideas can be thought of as the pillars upon which any modern language stands. vs. inheritance and right of the bat, we tend to see a obtrusive distinction between the 2 concepts. Inheritance is the concept that allows the code to be reused...