+ 2
Could someone explain difference between interface and abstract class?
I know a few differences but I was wondering if someone could add examples to supplement my learning
1 Antwort
0
you can't extend more than 1 class in a class but you can implement as many interfaces as you can
Example:
You got a concrete class 'Car'
then, you got some abstract classes called 'SUVCar' and 'PickUpCar'
if you got a Renault Oroch car, that is both types, you should use Interfaces instead of Abstract Classes