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
what is inheritancy where u required ?
What is the difference between l1 and l2 cache? : Dot net architecture
Explain dotnet framework ?
Explain different pipelining hazards and how are they eliminated? : .NET Architecture
What happens to the winfx technologies?
What is the difference between metadata and menifest ?
deference between display and visibility property of CSS
Explain the race around condition? : .NET Architecture
8. Oop-Why and were we use Interfacse and Abstract class.
Do you know textbox and textview controls of .net mobile? : Microsoft dot net mobile
How do I prevent concurrent access to my data?
Define an interrupt? : Dot net architecture
Explain domestic architecture artifacts? : .NET Architecture
Explain
How to develop mobile applications using microsoft mobile internet toolkit (mmit) or .net mobile? : Microsoft dot net mobile