Why is the base() constructor not necessary?
- by Earlz
Hello, I have a class structure like
abstract class Animal {
public Animal(){
//init stuff..
}
}
class Cat : Animal {
public Cat(bool is_keyboard) : base() //NOTE here
{
//other init stuff
}
}
Now then, look at the noted line. If you remove : base() then it will compile without an error.
Why is this? Is there a way to disable this behavior?
I have had multiple bugs now from forgetting the base() which I would have thought to be required on such a special thing as a constructor.