Even generated from compiler the default constructor has a body.
Here is an example for a default constructor generated by the compiler (I've used
ildasm[
^] to get the IL code):
.method public hidebysig specialname rtspecialname instance void .ctor() cil managed
{
.maxstack 8
L_0000: ldarg.0
L_0001: call instance void [mscorlib]System.Object::.ctor()
L_0006: ret
}
From the IL code above you can easily spot the call to the default constructor of the base class (in our case
System.Object
).
Additionally if your class is
static
no constructors will be generated.
:)