Go to DotNetFunda.com
 Online : 1076 |  Welcome, Guest!   Login
 
Home > Interview Questions > C# Interview Questions > Constructor and Destructor ... ...

  • Download the OOPS, ASP.NET and ADO.NET Training Videos for FREE, click here.

call for mock interview

C# Interview Questions

Constructor and Destructor

Author: Syedshakeer | Posted on: 2/16/2009 10:52:32 AM | Category: C# | Views:951 |  Print | Asked In: Many Interviews


Answer:
Constructor:
-----------------

1. The Constructor is the first method that is run when an instance of a type is created. In visual basic a constructor is always Sub new ().

2. Constructor are use to initialize class and structure data before use. Constructor never returns a value and can be overridden to provide custom initialization functionality.

3. The constructor provides a way to set default values for data or perform other necessary functions before the object available for use.

Destructor:
---------------
Destructors are called just before an object is destroyed and can be used to run clean-up code. You can’t control when a destructor is called.

Interesting?   Share and Bookmark this


Navigate to:

 Submit Interview Questions

Difference between GET and POST Metods ...

Difference between VB.NET and C#. ...

Random Interview Questions
Help: If for some reason you are getting the same question by clicking Next Question or Previous Question, Try clicking Categories link above.

Related interview questions



Advertisement

About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)