Main features of abstract classes

Can Yüksel
2 min readApr 29, 2022

--

Hi Everyone,

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.

For example:

Abstract classes are used as in this picture. So that’s mean to “inherit”.

For example:

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.

For example:

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.

--

--

Can Yüksel

I’m Mining and software Engineer. I’m study at Dokuz Eylül University. I share the information I learned while developing myself in the field of software.