Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
An abstract class is needed in order to provide two or more other classes that will inherit it with the same access to some methods without implementing these methods in an abstract class.
For example, you have two classes "apple" and "orange".
And now, you want to "eat" them.
You call "apple1.eat" and "orange1.eat". Everything's OK. But, these two objects are not from the same ancestor, and it is impossible to say exactly that both objects actually have a "eat" method.
If this is clear, then let's move on.
An abstract method allows you NOT to write a method definition, but only its title.
I don't know exactly how it is in python. But, in an ordinary class, you must describe the method (let's say leaving it empty) and then other classes inherit from it. Whilein an abstract class, the implementation of the method is not needed , it is enough to say that the method is there and it must be implemented in all inherited classes, and also, you cannot create an object based on the abstract class .
https://en.wikipedia.org/wiki/%D0%90%D0%B1%D1%81%D
... ), which we take out into an abstract class and inherit from it
Абстра́кция (лат. abstractio — отвлечение) — теоретическое обобщение как результат абстрагирования.
const array = [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const predicate = num => num > 0 && num % 2 === 0;
const result = array.filter(predicate);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question