Out of curiosity, I parsed mscorlib.dll to check the implementation of the System.Object class.
In this, I found something strange.
1).
public class Object {
...
protected override void Finalize(){}
...
}
Why does the base class have an overridden method in it?
2) public class Employee {
public void InstanceMethod() {
this.Finalize();
//Does not compile, can i not access protected methods of base class??
}
}
I'm just wondering what is the use of the "protected Finalize" method in the Object class and why does it have special treatment with the compiler?
source
share