   C# - Accessing last element in a List.
  Hi,I have a question about accessing the last element in a list. I am entering a function and creating a new sprite object which is stored into a List.  I then need to access the sprite object I just added so I can further do work on it.  I am stumped on how to make sure I access what I just added. // A collection of sprite objects   private List<Sprite> sprites;   public void AddNewSprite(string filePath)   {  sprites.Add(new Sprite(this,appReference.GetContentManager()));  //I need to acces the element I just added so I can all the following function on it  //sprite.LoadSprite(filePath);    }Any help would be great.RegardsChad   
// A collection of sprite objects   private List<Sprite> sprites;   public void AddNewSprite(string filePath)   {  sprites.Add( new Sprite(this,appReference.GetContentManager()));  Sprite sprite = sprites[sprites.Count-1];  sprite.LoadSprite(filePath);    };  There's no need to get the last element if you just write code that is a bit more explicit and readable...public void AddNewSprite(string filePath){    Sprite newSprite = new Sprite(this,appReference.GetContentManager());    sprites.Add(newSprite);   newSprite.Load(filePath);}But, if you must get the last element you can do as mentioned above by Cyansoft, or if you are including System.Linq:sprites.Last().LoadSprite(filePath);