What will be the output of is_contains variable?

Dim is_contains As Boolean = False
Dim lst_courses As New List(Of String)
lst_courses.Add("C#")
lst_courses.Add("VB.Net")
lst_courses.Add("ASP.Net")

is_contains = IIf(lst_courses.Contains("C#"), True, False)

 Posted by Rajesh_Kumar on 1/18/2014 | Category: VB.NET Interview questions | Views: 3328 | Points: 40
Answer:

It will return True.As contains method returns True if it finds value inside List otherwise False.
Here,lst_course have C# item.And Contains method is checking whether C# is there in a List.So it will find C# inside lst_courses.So it will return True.
So the value of is_contains will be True.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response