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 many types of controls are there in windows and web application?
What are .net mobile controls features? : Microsoft dot net mobile
Explain the differences between Server-side and Client-side code?
what does dot in .net means
Are there any third party logging components available?
can aspx page have multi language declarations ?
What is .net mobile input validation. Explain with an example? : Microsoft dot net mobile
what is the use of SQL command builder class in C#.net? Explain how can we execute a stored procedure using C#.Net? What is the difference between .DLL and .EXE?
How can we perform data binding in atlas?
which tag i need to use manually to bind columns in a datagrid ?
How do I stop a thread?
What is the numeric attribute of the textbox control in .net mobile? : Microsoft dot net mobile