Ask your own question, for FREE!
Computer Science 16 Online
OpenStudy (anonymous):

what is a constuctor and destructor? My book is not saying what they are, just that they are.

OpenStudy (asnaseer):

a constructor is typically where you would initialise your newly constructed object. for example, this is where you might open a connection to a database, or allocate some memory, etc. a destructor is the opposite - it is where you would finalise the object just before it gets destroyed. for example, this is where you might close a connection to a database, or free some memory, etc.

OpenStudy (anonymous):

adding to the aboe definition a constructor is not called by an object. It is just called when an object is created.When an object is created some variables must be intialised .

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!