You must Sign In to post a response.

different types of constructors in oops

The forum thread has not been reviewed by Editors yet. Readers are advised to use their best judgement before accessing this thread.
This thread will be reviewed shortly.
If you think this thread contain inappropriate content, please report to webmaster.
Tell me the different types of constructors in .Net and the difference between them


Comments

Author: Anusha07 Feb 2006 Member Level: Bronze   Points : 2

Check out the following links.

http://www.dotnetdevs.com/advice/PreferFactories.aspx

http://www.codeproject.com/dotnet/ConstructorsInCSharp.asp

Author: Sukanya 08 Feb 2006 Member Level: Gold   Points : 2

Hi,
You will have default constructors(initialize constructors),Parameter Constructors....

Author: HimaBindu Vejella07 Jun 2006 Member Level: Gold   Points : 2

default constructor
Overloaded constructor
Static Constructor

Author: DotNetGuts (DNG)26 Aug 2006 Member Level: Gold   Points : 2

check out my article section
http://www.dotnetspider.com/profiles/ProfileArticles.aspx?userId=CodeGuruDotNet

Author: Subodh kumar Prajapati04 Jun 2007 Member Level: Gold   Points : 2

There are :

Default constructor :- There is no parameters.
Parameterised constructor. :- they have single or more then one paramertised constructor.

Author: Mrs. Meetu Choudhary Nanda13 Feb 2009 Member Level: Gold   Points : 5

A procedure or function or method that is used for creating and initializing objects. In any language, constructor is called after the object has been created and is used mainly to initialize the object's internal state i.e. there member variables. It is a special method that initializes an object when the object is created. In the class, a constructor has the same name as the class.


we have following types of constructors

1. copy constructor
2. default constructor
3. naval constructor
4. universal constructor
5. virtual constructor
6. constructor function
7. constructor brabham
8. taller del constructor

e.g. of copy constructor

class a
{
public int x;
public a()
{
x=10;
}
public a(class z) \\ copy constructor
{
x=100;
}
}
class b
{
public static void Main()
{
a obj1 = new a();
System.Console.WriteLine(x) ;
b obj2 = new a(obj1);
System.Console.WriteLine(x) ;

}
}
output
10
100;


Sign In to post your comments