Raj Kumar M
What is Constructor?
By Raj Kumar M in ASP.NET on Jun 14 2008
  • Bechir Bejaoui
    Jun, 2008 15

    A construcor is a method that returns nothing, It is used to instanciate an object and also helps us to perform some tasks exactly when the object is instanciated example: class MyClass { //no constructor ............... } When I want instanciate an object I can't example: MyClass object = new ? class MyClass { MyClass() {MessageBox("Hi I'm MyClass instance")} } MyClass object = new MyClass() When I execute the program the first think done is to display message "Hi I'm MyClass instance"

    • 0
  • Raj Kumar M
    Jun, 2008 14

    When we create instance of class a special method of that class, called that is constructor. Similarly, when the class is destroyed, the destructor method is called. These are general terms and usually not the actual member names in most object-oriented languages. It is initialized using the keyword New, and is destroyed using the keyword Finalize

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS