what does it means

hi,
what this statment means:
List<ItemRequest> request = new List<ItemRequest>();

is it create XML?

full description will highly appreciated.
ethar1Asked:
Who is Participating?
 
williamcampbellCommented:
List<ItemRequest> request = new List<ItemRequest>();

List is a linked list of items... in this case the items are things called "ItemRequest"
You use the <  and >  to specify a 'type' it is not XML
List is part of C#
ItemRequest is a type in your Code somewhere and is probably a Class

The < and > relate to things called templates

What the line above is doing is creating a brand new list of the type ItemRequest in memory to work with

you can now say things like

 ItemRequest IR1 = new ItemRequest ( "Apple" );
 ItemRequest IR2  = new ItemRequest ( "Egg" );
 ItemRequest IR3 = new ItemRequest ( "Harrier Jump Jet" );

  request.Add (IR1);
  request.Add( IR2 );
  request.Add( IR3 );

  foreach ( ItemRequest ir in request )
 {
    Trace ( "The item is " + ir );
 };
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.