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 |
how to add list of items in a web application and win application?
How Web service create Proxy Using WSDL?
Is .net easier than java?
How does .net remoting work?
what is the need of vss to developer?
What is this DLL hell problem in dotnet? Can a virtual class be created/can a virtual method be created inside the class?
What is gui programming? : .NET Architecture
How can I write my own .NET host?
How do we do authentications using atlas?
Why should hire you in company
Hi, this is satish, i have more than 2 years of exp. on Microsoft .Net Technologies like C#, ASP.Net, VB.Net. But i am willing to change my platform into Testing tool. give me best suggestion for me.
What is the difference between metadata and menifest ?