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 |
I want to create a project like google maps how can we do that with atlas?
what is just in time compilation?
Which tool you will use to deploy a windows service
What is the difference between custom controls and master page?
Why only boxed types can be unboxed?
Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component
Explain the differences between Server-side and Client-side code?
Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?
Explain Singleton design pattern in .net
What other than biginteger has been introduced in system.numerics namespace?
how u maintain data while navigating one page to another?
where should I put this information then?