Wrap Up

Basically, we can override most of the method in System.Object. Now, we want to briefly explained what other objects mean.

  • Finalize() is used by the memory management system, also known as the garbage collector. Every time new object is created, it's stored some place in computer's memory. We may create a lot of objects, eventually we don't need access to some of these objects anymore. Periodically .NET memory management system runs the garbage collector which goes to memory and finds object that aren't being used by program anymore. We're given opportunity to run some final code right before the object is removed, that's the purpose of finalize() method.
  • MemberwiseClone() method is use to create a copy of an object.
  • Overriding Equals method must overriding the GetHashCode() method too

results matching ""

    No results matching ""