Define Delegate. ---------------------------------------------------------- Delegates are kind of similar to the function pointers. But they are secure and type-safe. A delegate instance encapsulates a static or an instance method. Declaring a delegate defines a reference type which can be used to encapsulate a method having a specific signature.
What is the difference between Finalize() and Dispose()? ---------------------------------------------------------------------------------------- Dispose() is called by as an indication for an object to release any unmanaged resources it has held. Finalize() is used for the same purpose as dispose however finalize doesn’t assure the garbage collection of an object. Dispose() operates deterministically due to which it is generally preferred.
Define Delegate.
ReplyDelete----------------------------------------------------------
Delegates are kind of similar to the function pointers. But they are secure and type-safe.
A delegate instance encapsulates a static or an instance method.
Declaring a delegate defines a reference type which can be used to encapsulate a method having a specific signature.
What is the difference between Finalize() and Dispose()?
ReplyDelete----------------------------------------------------------------------------------------
Dispose() is called by as an indication for an object to release any unmanaged resources it has held.
Finalize() is used for the same purpose as dispose however finalize doesn’t assure the garbage collection of an object.
Dispose() operates deterministically due to which it is generally preferred.