I came to one solution.
For the above case i think we cannot use Contins() or Find().
But use ToArray()
Console.Write("Enter a name for search: ");
string n = Console.ReadLine();
Employee[] emparr=new Employee[list.Count];
emparr = list.ToArray();
int c = 0;
for (c = 0; c < list.Count; c++)
{
if (emparr[c].empName == n)
{
break;
}
}
Console.WriteLine("Name is: "+emparr[c].empId+" Basic Salary is: "+emparr[c].basicSal);
Can we use Find() or Contains() method instead ??