Why abstract class has constructor even though you Cannot create object? – Enpatika
Skip to content
Yeni Enpatika Logo

Enpatika

En Güncel Oyun ve Sistem Gereksinimleri Sitesi

  • Ana Sayfa
  • Gizlilik Politikası
  • Telif Hakları
  • İletişim
  • taraftar tv apk

Why abstract class has constructor even though you Cannot create object?

Why abstract class has constructor even though you Cannot create object?

1 April 2022 Enpatika.com Genel

you can’t create a object of abstract class because there is an abstract method which has nothing so you can call that abstract method too . If we will create an object of the abstract class and calls the method having no body(as the method is pure virtual) it will give an error.

Read more

Should abstract class have constructor?

1 April 2022 Enpatika.com Genel

Yes, an Abstract class always has a constructor . If you do not define your own constructor, the compiler will give a default constructor to the Abstract class.

Read more

Why do we need constructor in abstract class C#?

1 April 2022 Enpatika.com Genel

Answer: Yes, an abstract class can have a constructor. In general, a class constructor is used to initialize fields . Along the same lines, an abstract class constructor is used to initialize fields of the abstract class.

Read more
WordPress Theme: Gridbox by ThemeZee.