Main features of abstract classes
Let’s look at the importance and properties of abstract classes today. Abstract classes are important in reducing code repetition and writing code that conforms to the clean code structure. Abstracts classes must use to implement in all of method to classes.
Abstract classes are used as in this picture. So that’s mean to “inherit”.
Classes use the methods of the abstract classes they inherit by overriding them. For example like on this picture , “onbefore” method’s a override method.
Main features of abstract classes:
· Abstract classes cannot be defined as “private” but can be defined as “public” and “protected”.
· Abstract methods must be declared in the derived class. However, abstract methods can only be declared in abstract classes.
· Abstract methods must be overridden, otherwise a compiler error will be thrown.
· “Static” methods cannot be defined abstractly.
· Abstract classes do not define objects of the “abstract” type.
· Abstract classes can also contain non-abstract methods.
Finally today we looked at features of abstract classes together. Thanks for reading my post 😊
Have a good day, good codes.