#63 Polymorphism-C#

Polymorphism: Takes Many Forms.


1.Compile Time-(Early Binding/Overloading):Methods can have same name,with different number of arguments.

2.Run Time-(Late Binding/dynamic):Objects of Base Class can Point to objects of Derived class At Runtime.(using Override)

#60 Lock-C#

Lock is a thread safe mechanism,where you allow only one thread to access a  block of code(Critical Section) and block other threads,untill the current thread releases the lock(Mutual Exclusion).

lock (object)
 // crtical section

Internally the Lock get’s translated with Monitor.Enter(Object) and Monitor.Exit(object). Lock is a wrapper/high level construct provided by C#.