You can use LINQ to get the desired object:
ABC newobj = a.Where(abc => abc.ID == 100).FirstOrDefault();
Which returns null if there is no matching identifier.
As suggested by @Xanatos, you can also use this neat version:
ABC newobj = a.FirstOrDefault(abc => abc.ID == 100);
As suggested by @Jon, it would be better to use Dictionary<int, ABC> to store your ABC instances. It provides better performance than ever, iterating through a Collection to find the appropriate identifier. But then the key must be unique, you cannot add two ABC instances with the same identifier:
var a = new Dictionary<int, ABC>(); a.Add(100, new ABC(100, "First")); a.Add(101, new ABC(101, "Second")); a.Add(102, new ABC(102, "Third"));
You will access it as follows:
ABC newobj = a[100];
source share