Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what are constructors and destructors



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

Post New Answer

More Dot Net AllOther Interview Questions

Explain domestic architecture artifacts? : .NET Architecture

0 Answers  


What is textview control of .net mobile? : Microsoft dot net mobile

0 Answers  


What is .net mobile lists. : Microsoft dot net mobile

0 Answers  


how to use custom field validation

0 Answers   PCS, Prithvi,


What happens to the winfx technologies?

0 Answers  


Explain cache? : Dot net architecture

0 Answers  


Explain the difference between state server and sqlserver : Dot net architecture

0 Answers  


What is serialization, how it works in .NET?

1 Answers  


What is .net mobile images control. Explain with an example? : Microsoft dot net mobile

0 Answers  


When should you use Abstract Class vs Interface while programming? Give 1 Example

3 Answers   CSS Corp, Hexaware, T3 Softwares,


4. Wcf- what Asych and Sych call and how that works

0 Answers   PCS,


i wish to write mcts(microsoft certified technology specialist) exam. can anyone give the model question or format and preparation method?

0 Answers  


Categories