C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Constructors


Posted Date: 10 Oct 2008    Resource Type: Definitions    Category: General

Posted By: Meetu Choudhary       Member Level: Gold
Rating:     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

--
Thanks and Regards
Meetu Choudhary




Responses

Author: lingesh    14 Oct 2008Member Level: Silver   Points : 2
Ya the copy constructor is the most interesting one because we pass the object during the object creation.

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;



Author: lingesh    14 Oct 2008Member Level: Silver   Points : 2
Ya the copy constructor is the most interesting one because we pass the object during the object creation.

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;



Author: Meetu Choudhary    14 Oct 2008Member Level: Gold   Points : 1
Yes Very True
Nice Example Given by you thanks

==
Thanks and Regards
Meetu Choudhary
-
http://www.dotnetspider.com/sites/20/-Learn-ASP-Net.aspx
http://www.dotnetspider.com/sites/21/-DotNet-Expertise.aspx


Author: lingesh    20 Oct 2008Member Level: Silver   Points : 1
Anybody know about the static constructors?
does it only declared in static classes or normal classes?


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Constructors  .  Constructor  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: AJAX
Previous Resource: What is strong name?
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

conference call

Contact Us    Privacy Policy    Terms Of Use