0

What does abstract mean and for what is it used for in programing , hardware and math

7th Oct 2019, 7:35 AM
Radoslav Kostov
Radoslav Kostov - avatar
2 ответов
+ 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 😊.
7th Oct 2019, 8:39 AM
D_Stark
D_Stark - avatar
+ 1
Thank you so much
7th Oct 2019, 8:49 AM
Radoslav Kostov
Radoslav Kostov - avatar