Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Constructor overloading
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00996906
Message ID:
00996922
Vues:
10
>I am having one of those moments where I can't remember syntax (might be related to too much green beer <s>)
>I am trying to overload a constructor:
>
>public myConstructor(string para0)
>{
>  // call the "2nd" constructor passing para0 and the string "einar" for para1
>}
>
>public myConstructor(string para0, string para1)
>{
>  // do something i.e. constructor code
>}
>
>
>How do I call the constructor again passing 2 parameters from the constructor accepting 1 parameter?
>
>Einar

Einar,

I believe the syntax is:
public myConstructor(string para0):myConstructor(para0, "einar")
{
  .....
But, it's been a while since I did this so I may be remembering incorrectly.

HTH,
Chad
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform