Click here to Skip to main content
15,908,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guyz,
what is the meaning tilde(~) in a method ~ProcessQueue()

thanks in advance!
Posted

It means that it's the definition of the Finalise method for the ProcessQueue class. Thanks for asking this. Getting the answer from google was so trivial that I don't know why you needed to, but I did not know this, and now I do.
 
Share this answer
 
Comments
Member 8092191 28-Jul-11 21:52pm    
i cant understand.. can you give me some samples pls.. thanks
You must have created a constructor by name ProcessQueue() within the class ProcessQueue. When you write ~ProcessQueue(), it calls the destructor. A destructor is a special method that releases the instance of class. The destructor is called only when the object is no more required.

Note: The .Net framework automatically cleans up the memory used by the class even when you don't call it.
 
Share this answer
 
This is a destructor.
You may read this to understand how it works in C# (since destructors in C/C++ are sligthly different):
http://www.c-sharpcorner.com/UploadFile/chandrahundigam/UnderstandingDestructors11192005021208AM/UnderstandingDestructors.aspx[^]
 
Share this answer
 
Class have a constructor.
When we create the object of a class at that time constructor are used to initialize the object. Every class must have constructor.

Symbol ~ is indicate the destructor. It works opposite the constructor. It free the memory used by the constructor in initialization.

CONSTRUCTOR: sum();

DESTRUCTOR: ~sum();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900