22-11-2012, 05:43 PM
Static Constructor
[attachment=40740]
Static Constructor (Contd)
•A Static Constructor does not takes any parameters and does not use any access modifiers because it is invoked directly by the CLR instead of the object.
•It cannot access any non static data member of the class.
Constructor Overloading
•The Concept of declaring more than one constructor in a class is known as Constructor Overloading.
•Every Constructor has a signature similar to that of method.You can create multiple Constructors in a class each having a different signature.
Destructor
•A destructor is a special method which has the same name as the class but starts with the “~” character before the class name.
•Destructors immediately de-allocate memory of objects that are no longer required.They are invoked automatically when the objects are not in use.
Inheritance
•The purpose of Inheritance is to reuse common methods and attributes among classes without recreating them.
•Reusability of codes enables you to use the same code in different applications with little or no changes.
Method Overriding
•Method Overriding is a feature that allows the derived class to override or redefine the methods of the base class.
•Overriding a method in the derived class can change the body of the method that was declared in the base class.
•Thus the same method with same name and signature declared in the base class can be reused in the derived class to define a new behavior.
•Private methods are not overridden anyhow.