Forums » .NET » .NET »

different types of constructors in oops


Posted Date: 07 Feb 2006      Posted By:: Alla.Harini     Member Level: Silver    Member Rank: 0     Points: 2   Responses: 6



Tell me the different types of constructors in .Net and the difference between them



Responses

#40849    Author: Anusha      Member Level: Bronze      Member Rank: 0     Date: 07/Feb/2006   Rating: 2 out of 52 out of 5     Points: 2

Check out the following links.

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

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


 
#40991    Author: Sukanya       Member Level: Gold      Member Rank: 190     Date: 08/Feb/2006   Rating: 2 out of 52 out of 5     Points: 2

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


 
#57360    Author: HimaBindu Vejella      Member Level: Gold      Member Rank: 42     Date: 07/Jun/2006   Rating: 2 out of 52 out of 5     Points: 2

default constructor
Overloaded constructor
Static Constructor

http://himabinduvejella.blogspot.com
http://sysntaxhelp.com/asp.net
http://groups.google.com/group/mugh





 
#71831    Author: DotNetGuts (DNG)      Member Level: Gold      Member Rank: 71     Date: 26/Aug/2006   Rating: 2 out of 52 out of 5     Points: 2

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

DotNetGuts (DNG)


 
#126933    Author: Subodh kumar Prajapati      Member Level: Gold      Member Rank: 273     Date: 04/Jun/2007   Rating: 2 out of 52 out of 5     Points: 2

There are :

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


 
#347031    Author: Miss Meetu Choudhary      Member Level: Gold      Member Rank: 14     Date: 13/Feb/2009   Rating: 2 out of 52 out of 5     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;

Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Return to Discussion Forum
Start new thread

Subscribe to Subscribers
Awards & Gifts
Talk to Webmaster Tony John

Online Members

Atul
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India