Click here to Skip to main content
15,908,674 members
Home / Discussions / C#
   

C#

 
QuestionConstructors & Destructors? Pin
moazzamahmed12-Jan-06 19:46
moazzamahmed12-Jan-06 19:46 
AnswerRe: Constructors & Destructors? Pin
Guffa12-Jan-06 21:08
Guffa12-Jan-06 21:08 
moazzamahmed wrote:
Is there also a destructor for
C# classes?


Yes, it's called Finalize.

moazzamahmed wrote:
and is it invoked when I do a

set myobject = nothing


No. It's invoked when the garbage collector is about to remove the object.

If you need to do any cleanup in your object, you should inherit the IDisposable interface and implement the Dispose method.

moazzamahmed wrote:
also, if Im creating one of those classes that you DONT have to
instantiate (what are they called again?), how does the constructor
and destructor get called?


Do you mean a static class? As you don't instantiate it, the constructor or destructor aren't used. Actually, you should declare a private constructor so that noone can create an instance of the class. However, you can also declare a static constructor for the class, that will be called once when the library is loaded.

---
b { font-weight: normal; }

GeneralRe: Constructors & Destructors? Pin
moazzamahmed13-Jan-06 7:06
moazzamahmed13-Jan-06 7:06 
GeneralRe: Constructors & Destructors? Pin
Dan Neely13-Jan-06 8:09
Dan Neely13-Jan-06 8:09 
AnswerRe: Constructors & Destructors? Pin
Guffa15-Jan-06 23:00
Guffa15-Jan-06 23:00 
QuestionDot Net Deployment Pin
chudapji12-Jan-06 18:34
chudapji12-Jan-06 18:34 
AnswerRe: Dot Net Deployment Pin
mav.northwind12-Jan-06 20:30
mav.northwind12-Jan-06 20:30 
GeneralRe: Dot Net Deployment Pin
chudapji13-Jan-06 0:51
chudapji13-Jan-06 0:51 
QuestionShow menu from form other than MDI form? Pin
MudkiSekhon12-Jan-06 18:19
MudkiSekhon12-Jan-06 18:19 
AnswerRe: Show menu from form other than MDI form? Pin
Luis Alonso Ramos12-Jan-06 18:24
Luis Alonso Ramos12-Jan-06 18:24 
GeneralRe: Show menu from form other than MDI form? Pin
MudkiSekhon12-Jan-06 18:31
MudkiSekhon12-Jan-06 18:31 
GeneralRe: Show menu from form other than MDI form? Pin
Luis Alonso Ramos12-Jan-06 18:37
Luis Alonso Ramos12-Jan-06 18:37 
GeneralRe: Show menu from form other than MDI form? Pin
MudkiSekhon12-Jan-06 19:04
MudkiSekhon12-Jan-06 19:04 
GeneralRe: Show menu from form other than MDI form? Pin
Luis Alonso Ramos13-Jan-06 5:20
Luis Alonso Ramos13-Jan-06 5:20 
QuestionCrystal Report Deployment in C# Pin
aarontan12-Jan-06 18:16
aarontan12-Jan-06 18:16 
AnswerRe: Crystal Report Deployment in C# Pin
CooperWu12-Jan-06 21:24
CooperWu12-Jan-06 21:24 
QuestionHttpWebRequest and SSL Authentication Pin
Skoder12-Jan-06 17:48
Skoder12-Jan-06 17:48 
QuestionDataGrid Issue, Please Help Pin
student_rhr12-Jan-06 16:41
student_rhr12-Jan-06 16:41 
AnswerRe: DataGrid Issue, Please Help Pin
Daniel Santillanes13-Jan-06 4:50
professionalDaniel Santillanes13-Jan-06 4:50 
AnswerRe: DataGrid Issue, Please Help Pin
Drew McGhie13-Jan-06 5:49
Drew McGhie13-Jan-06 5:49 
GeneralRe: DataGrid Issue, Please Help Pin
student_rhr13-Jan-06 6:35
student_rhr13-Jan-06 6:35 
GeneralRe: DataGrid Issue, Please Help Pin
student_rhr13-Jan-06 6:53
student_rhr13-Jan-06 6:53 
QuestionGenerics and the form designer in VS2005 Pin
Luis Alonso Ramos12-Jan-06 16:26
Luis Alonso Ramos12-Jan-06 16:26 
GeneralRe: Generics and the form designer in VS2005 Pin
Luis Alonso Ramos12-Jan-06 19:01
Luis Alonso Ramos12-Jan-06 19:01 
QuestionGenerate exe file from the C# program Pin
tadung12-Jan-06 15:04
tadung12-Jan-06 15:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.