What is it with the < > brakets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am coming back to programming in C#, and perhaps I never came accross
this. Can someone point me in the right direction to research about them. For
instance, what do they mean in the following code:

<!-- From msdn web site content -->
// First attempt:
public List<string> PeopleIKnowInNewYork()
{
IEnumerable<PhoneBookEntrys> newYorkNumbers =
PhoneBook.FindListFor(“New Yorkâ€);
List<string> peopleIKnow = new List<string>();
foreach ( PhoneBookEntry ph in newYorkNumbers)
{
string name = string.Format(“{0} {1}â€, ph.FirstName, ph.LastName);
if ( RecognizePerson( name ) )
peopleIKnow.Add(name);
}
return peopleIKnow;
}
 
The "Brackets" < > are the syntax for declaring the Collection type of a
Generic List.
That means the List is declared to hold the type that appears inside these
< > guys.
Peter
 
Thank you Peter.
I feel like a need a "matrix like learning" machine.
E.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top