Physics, asked by bgkbs2565, 1 year ago

Explain with suitable example ‘polymorphism’ and ‘Inheritance’.

Answers

Answered by Anonymous
1

Answer:

Explanation:

The capability of a one class to inherit the capability of another class known as inheritance .

Ex:-

password

Polymorphism:-

we can defined as the many forms which can define in a single actions.

example:-

after parents class

⬇️

there is two child class

Hope it helps u^_^

Answered by SHREYABHATlA
4

Inheritance is one in which a new class is created (derived class) that inherits the features from the already existing class(Base class). Whereas polymorphism is that which can be defined in multiple forms. ... Inheritance supports the concept of reusability and reduces code length in object-oriented programming.

Similar questions