Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Some C# questions.
Message
De
05/01/2007 03:20:32
James Hansen
Canyon Country Consulting
Flagstaff, Arizona, États-Unis
 
 
À
05/01/2007 01:22:16
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01181975
Message ID:
01182684
Vues:
10
Generally speaking in the OOP world, things that look like a characteristic or "property" of an object, such as a string's length or a control's BackColor, are usually defined as properties. Things that act on an object, like an object's ToString (formatting) or a form's Close (closing), are usually defined as methods.

In the case of ToString, it also sometimes takes a parameter to set the formating for the conversion, so it doesn't really look like a property when referenced that way.

...Jim

>
>You know whats freaking me out about C# right now?
>It's that user define variables come with what seems like a built in function and properties like
>
>MyVariable.ToString();
>MyVariable.Length;
>
>
>But why is Length a property and ToString a function?
>
>Thanks folks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform