What will be the output of below code?

List<int> lst = new List<int>();
lst.Add(1);
lst.Add(2);
bool exists = lst.Exists(value => value > 2);

 Posted by Rajesh_Kumar on 1/18/2014 | Category: C# Interview questions | Views: 853 | Points: 40
Answer:

It will return false.Because as we can see list have 2 items as 1 and 2.And we are checking value > 2.So it will return false.Because there are no greater value other then 2.So the condition will always be false.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response