Answer Posted / dsr
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 ? | 11 Yes | 3 No |
Post New Answer View All Answers
Explain cache? : .NET Architecture
What are the types of application software?
Different types of authentication modes in .net framework ?
What is .net mobile utility controls. Explain with an example? : Microsoft dot net mobile
if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get
Explain difference between machine config vs. Web config : Dot net architecture
What is the problem with .net generics?
Define cache coherency? : Dot net architecture
Explain hard disk and what is its purpose? : .NET Architecture
Explain about .net garbage collector?
What is cache coherency and how is it eliminated? : .NET Architecture
Explain Intermediate Language?
What are the main Tools to develop .Net Application?
Tell me .net mobile emulators? : Microsoft dot net mobile
What is the use of TPL DATAFLOW?