Series: Subject: Topic:
Question: 6 of 27

what is a difference between free and destroy?

Asked by: Interview Candidate | Asked on: Oct 18th, 2007
Showing Answers 1 - 1 of 1 Answers

Answered On : Feb 13th, 2008

View all answers by van_falen

If you write your own code to instantiate objects, you are responsible for disposing of them as well. Every object inherits a Destroy method (called a destructor) from TObject. To destroy an object, however, you should call the Free method (also inherited from TObject), because Free checks for a nil reference before calling Destroy. For example,Employee.Free;destroys the Employee object and deallocates its memory.

Yes  1 User has rated as useful.
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions



twitter fb Linkedin GPlus RSS


Interview Question

 Ask Interview Question?


Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.