ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net AllOther
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
what are constructors and destructors
 Question Submitted By :: Raghu_113
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what are constructors and destructors
Answer
# 1
A constructor is a method, which is called when an object 
of a class type is constructed, and it usually used for 
initialization. A constructor method has following 
characteristics:

It has the same name as class 

It has no return type 

It does not return any value 

Constructors are always public and we use them to 
initialize variable. 

There is default class constructor without parameter, 
provided by C# internally if we did not write any 
constructor. when ever compile that class,compiler create 
the default constructor(with out parameters).

In the other hand a Destructor is also called a finalizer. 
It is just opposite the constructor, it is a method called 
when the garbage collector reclaims an object. 

Constructors have following characteristics:

The name of a destructor is same as name of class 

The destructor declared with a tilde (~). 

Destructors are always public and never other than public. 

Destructors take no arguments. So, there is only one 
destructor per class. 

Destructors have no return type.
 
Is This Answer Correct ?    4 Yes 1 No
Dsr
 

 
 
 
Other Dot Net AllOther Interview Questions
 
  Question Asked @ Answers
 
What is this DLL hell problem in dotnet? Can a virtual class be created/can a virtual method be created inside the class? HCL2
2. I've a class Parent Class A and a Derived Class B. Here is a scenario. I've an instance of Class A as objA and an instance of Class B as objB. I can refer a child class variable as objB=objA, but cannot do objA=objB what is the reason? 247Customer1
How many types of languages does .net support? name at least 10-15? Six-Sigma7
What is the main Difference Between .Net 2003 and .Net 2005.and also Asp1.1,Asp2.0 and Asp3.0 Satyam4
What does the "EnableViewState" property do? Why would I want it on or off?  1
Will finally block exec if we write an return statement to a try block???????  2
what is the difference between asp and asp.net Six-Sigma1
Which is the best institute in chennai to learn DotNet? Please help.  17
What is the difference between SAX Parser and DOM Parser? TCS1
Please tell me the .net 2.5 frame work with example  2
does .NET support multiple inheritance ? Ness-Technologies10
What is ITIL? What is the use of ITIL and how it works? IBM1
what is class and object explain with example? Six-Sigma2
What is the difference between a web custom control,web user control and a web part. 247Customer1
how windows applications different from the console applications? Six-Sigma1
What is a memory management? Six-Sigma3
3. Should validation (did the user enter a real date) occur server-side or client-side? Why?  3
what is web service?  1
what is the shortcutkey for solution explorer and add new item? Six-Sigma1
how would you manage data if u were not to use sessions or cookies ? Ness-Technologies2
 
For more Dot Net AllOther Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com