Welcome to WebmasterServe!

FREE TO JOIN! Join us now to engage in informative and friendly discussions about Webmastering, SEO, SEM, Internet Marketing, Programming, Graphic Design, Online Jobs and more. What are you waiting for? Ready to join our friendly community? It takes just one minute to register.

Dismiss Notice

Join WebmasterServe Forums 
Join the discussion! Have a better idea or an opinion? It takes just one minute to register Click Here to Join

My 2 Cents Difference Between Constructer And Destructor

Discussion in 'General Programming Discussions' started by Swati Mishra, Mar 14, 2016.

  1. Swati Mishra

    Yellow Belt

    Joined:
    Dec 28, 2015
    Messages:
    644
    Ratings:
    +105 / -0
    These are the basic difference between constructor and the destructor which is describe below

    • Constructor has the same as its class name whereas the destructor has the same as its class name but prefixed with ~ (tilde).
    • Constructor is called when new instance of class is created, whereas the destructor is called when instance of a class is deleted.
    • Constructor allocates the memory, whereas the destructor releases the memory.
    • Overloading is possible in constructor, whereas the overloading is not possible in destructor.
     

Share This Page