When and Why to use abstract classes/methods? -
I have some basic questions about abstract classes / methods. I know the basic use of basic classes is to create templates for future classes. But do they have more uses? When and how should you like them on the interface? Besides, when are abstraction methods useful?
I know that the basic use of basic classes is to create templates for future classes. But is there any more use of these?
Not only can you define a template for children, but abstract classes have offered an added benefit to defining your functionality, which your child will use later on
You can not provide an implementation for an interface.
When should you like the interface and when not?
Abstract classes are a good fit if you want to provide implementation details to your children, but do not want to allow an example of your class directly to the institute (which allows you to partially Allows to define a class)
If you want to define a contract to follow only the objects, then use an interface.
In addition, whenever abstraction methods are useful?
Abstract methods are useful in the same way that are useful in defining methods in the interface. I is a method for the designer of the abstract category that "any of my children apply this method Must be done ".
Comments
Post a Comment