0
What does abstract mean and for what is it used for in programing , hardware and math
2 Respuestas
+ 7
If you cant think of what somthing looks like but know what it does the chances are that thing should be in an abstract class
For example
I don't know what a animal looks like but I know the basics of what all animals do and have (animal should be in an abstract class as you cannot make an object of this is real life)
I know what a lion looks like and what it can do (lion would be in a normal class which would extend abstract animal class and override some of its methods)
Using this pattern works with polymophisim which means when you create a instance of lion this object can be refreneced by it's super class or its self as a lion is both a animal and a lion and can act as both 😊.
+ 1
Thank you so much