Why is inheritance important in programming?
I understand what inheritance does... it makes use of the code on class A so class B can use the same code as well as new methods instead of retyping the code for class A again, making code smaller but wouldn't it be easier to just add new methods to class A instead of creating class B in the first place?

thanks for reading and for the help to understand
Why is inheritance important in programming?
===

I understand what inheritance does... it makes use of the code on class A so class B can use the same code as well as new methods instead of retyping the code for class A again, making code smaller but wouldn't it be easier to just add new methods to class A instead of creating class B in the first place?

thanks for reading and for the help to understand