473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

what is the meaning of this syntax ? public ComboBoxExItem(: this("")

Hi

i found this in an example class, but never saw this syntax before.

thais was inside a derived class of a combobox

public ComboBoxExItem() : this("")

{

}

public ComboBoxExItem(string text): this(text, -1)

{

}

why isthe method followed by : this ("") ?


Nov 17 '05 #1
2 2003
Sagaert Johan <RE*************@hotmail.com> wrote:
i found this in an example class, but never saw this syntax before.

thais was inside a derived class of a combobox

public ComboBoxExItem() : this("")

{

}

public ComboBoxExItem(string text): this(text, -1)

{

}

why isthe method followed by : this ("") ?


See http://www.pobox.com/~skeet/csharp/constructors.html

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2
Sagaert,

Basically, the constructor that has no parameters will call the
constructor that takes a string parameters before the code in the brackets
is called. That constructor will call the constructor that takes a string
and an integer. Once that constructor is done, it will walk back up the
stack, executing the code in the brackets.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Sagaert Johan" <RE*************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi

i found this in an example class, but never saw this syntax before.

thais was inside a derived class of a combobox

public ComboBoxExItem() : this("")

{

}

public ComboBoxExItem(string text): this(text, -1)

{

}

why isthe method followed by : this ("") ?



Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Feverish | last post by:
I am a bit confused with the two marked lines. I have never seen such syntax even though I read a lot of C++ codes. Thanks for your suggestion... BluetoothReceiver::BluetoothReceiver() :...
3
by: ichor | last post by:
hi i have nt come acroos this syntax in OOP . can you plz explain what this means? public FormsView(DataInstance dataInstance): base(dataInstance) this is a constructor. thnx
3
by: lovecreatesbea... | last post by:
K&R2 sec 8.7 reads: union header{ /*...*/ }; typedef union header Header; /*...*/ Header *morecore(unsigned); /*?*/
1
by: avocado12 | last post by:
Hi, I'm sure this is very basic but it's difficult to google or search for because I'm searching for ":". Can anyone explain or point me to a reference for the ":" operator used in Javascript?...
3
by: Giuseppe:G: | last post by:
Hi, the following piece of code is rather obscure for me struct Foo { Foo( int _x ) : x(_x) {} .... }; what's the meaning of that construct? I understand Foo() must be a constructor,...
5
by: campyhapper | last post by:
I've seen this in C++, not Objective C: namespace bar { struct foo { foo (int a, int b) : int a_, int b_ {} }; }
6
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
double c = double.NaN; Console.WriteLine(c = 10); Console.WriteLine(c += 5); Console.WriteLine(c); output: 10 15 15
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.