TechArena Community

TechArena Community (
-   Software Development (
-   -   Paramatized Constructors in C # language (

Satchel 25-12-2010 08:27 AM

Paramatized Constructors in C # language
Hello My friends ,I am an IT student, I have not began my career in IT field yet , but I am looking forward to establish my career as a software developer . As far as the development is concerned I am a bit aware about that there are mainly two streams , one is for applications and software development and the other is for web development ,but I am more interested in software part rather than messing with the web development and all that concept. Today' s developers mostly follow the object oriented concept and I like a c # language the most , and I have gone through this technical forum and taken a lot of idea about these language, such as .NET framework, looping concept , Conditional statement and all that. But none o the threads include any idea about the paramatized Constructors in this language so it would be an add on benefit if you could feedback on the same. I am waiting for your response.

Dwarner 25-12-2010 08:29 AM

Re: Paramatized Constructors in C # language
Yes I too think that you should not go with the Web development. I will tell you why you should not mess with web development and all that. You will have to remember a lot of tags in that , since it uses a use of languages such as HTML , XML and all that. Well I have done graduation in IT as well, if you ask me why many people prefer Web more than in JAVA when they are asked about the elective , they do this because of the marks, but if you really want to be a good programmer and want to learn a lot in development process then you should choose JAVA over Web development. you will find constructors in all the languages, they are initialized as soon as object of any class is created.

Author 25-12-2010 08:30 AM

Re: Paramatized Constructors in C # language
All C# object constructors-come up with some exception of theSystem.Object constructors- comprise an calling of the parent class's constructor straight away before the execution of the beginning line of the constructor. These constructor initializers allow you to state which class and which constructor you want to invoke .

Jacques25 25-12-2010 08:31 AM

Re: Paramatized Constructors in C # language
This usually has two forms: -
  • An initializer of the form base(.) allows the present class's parent class constructor-that is, the particular constructor implied by the form of the constructor invoked to or to be invoked.
  • An initializer accepting the form this(.) allows the present class to invoke another constructor defined within itself. This is helpful when you have overloaded more than one constructor and want to ensure that a default constructor is always invoked. Overloaded functions are covered are quite difficult , but here is a small description : overloaded functions are are two or more functions a with the same name but differ in the type signature.

Shreevats 28-12-2010 08:30 AM

Re: Paramatized Constructors in C # language
If you are quite aware of the default constructor , they are similar to the class name but do not have in arguments in their round brackets . A programming language that allows the developers us to attain the objects but providing argument to the constructor method when the object are initialized . The constructor that can accept arguments are called parametrized constructors

class xyz{
int a,n;
abc(int x,int y); //paramererise constructor
abc::abc(int x,int y)

All times are GMT +5.5. The time now is 04:12 PM.