what are constructors and destructors
Answer / 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 |
Explain the difference between primary & secondary storage device? : Dot net architecture
how do you hide maximize,minimize and close box at the form title bar?
What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Explain in-proc,out-proc and sql server.
4 Answers G7 CR Technologies, Ness Technologies,
Define a managed code? : Dot net architecture
What is VSS? Use of VSS? How can we use VSS in our Application?
can Array contains different datatypes ?
What is an interrupt? : .NET Architecture
Does .NET runtime offer Deterministic Destruction or not?
Explain domestic architecture artifacts? : Dot net architecture
Explain the types of memory management? : Dot net architecture
6. Wcf- what is SOA