Java Programming Inheritance is an important concept in obje

Java Programming

Inheritance is an important concept in object oriented programming. It allows one class to acquire and extend all the behaviors and attribute of another class. In this context, What is the significance of the concept of inheritance within the concept of object oriented programming? Provide a programming problem in which inheritance should be used (You do not need to write codes for this discussion. Instead, describe the programming problem and explain why inheritance should be used). Research the concept of Polymorphism and, again, provide a programming problem in which polymorphism should be used.

Solution

One of the important features in the Object Oriented Programming is Reusability, as we said above that it is always good way to reuse the already existing functionality rather than trying to create the same one again and again. By reusing the properties not only saves the time and money but also increases the reliability.

An advantage of inheritance is that modules with sufficiently similar interfaces can share a lot of code, reducing the complexity of the program.

The Benefits of Inheritance

A programming example of inheritance could be of a calculator where we can define variables in one class and can use thosw variables in all the classes to compute different functions such as addition multiplication etc

the coding for suc example could be

2- POLYMORPHISM

Lets us look at an example of a car. A car have a gear transmission system. It has four front gears and one backward gear. When the engine is accelerated then depending upon which gear is engaged different amount power and movement is delivered to the car.

Polymorphism could be static and dynamic both. Overloading is static polymorphism while, overriding is dynamic polymorphism.

Java Programming Inheritance is an important concept in object oriented programming. It allows one class to acquire and extend all the behaviors and attribute o

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site