Re: Newbie Q: Explain: string Name = dept.FindChairperson().Name



"Rex" <RexForum4453@xxxxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:iima63pouvcch63c36mj27pcikcbhangm9@xxxxxxxxxx
Hi All,
Quick newbie question: I am NOT looking for some code solution - I am
simply looking for an explanation. In a passing bit of code in a C#
book I have, I saw the following line:

string Name = dept.FindChairperson().Name

I AM pretty much getting C# and its various syntaxes, but I had not
seen this before. Here's my question: It is clear that
"FindChairperson" is a method within the dept object. But then
how is ".Name" somehow subservient to the method?

The return type of FindChairperson has a property Name of type string (or a
type that is implicitly convertible to string).

I suppose it is a class representing in person and Name is the name of that
person.

To know more, you have to look at the definition resp. documentation of the
type of dept. Maybe the intellisense tells you more.

hth
Christof


.



Relevant Pages

  • Re: Proper way to input a dynamically-allocated string
    ... > I know it must sound like a newbie question, but I never really had to ... > array of char that's dynamically allocated. ... Every string container must have a ... for a really correct and useful solution you have to roll your ...
    (comp.lang.c)
  • Re: sed command to replace text with blank spaces
    ... >Newbie question here. ... Using 'perl' also gives you the option to make the '.*' ... then inserting it back into the string. ...
    (comp.unix.shell)
  • Re: Newbie Q: Explain: string Name = dept.FindChairperson().Name
    ... Quick newbie question: I am NOT looking for some code solution - I am ... simply looking for an explanation. ... how is ".Name" somehow subservient to the method? ...
    (microsoft.public.dotnet.languages.csharp)
  • Newbie Q: Explain: string Name = dept.FindChairperson().Name
    ... Quick newbie question: I am NOT looking for some code solution - I am ... In a passing bit of code in a C# ... how is ".Name" somehow subservient to the method? ...
    (microsoft.public.dotnet.languages.csharp)
  • String to Int
    ... Richard Blewett - DevelopMentor ... Kind of a newbie question, but I need to be able to convert a string to ...
    (microsoft.public.dotnet.languages.csharp)