Another great interview question.
Will the following code compile and if yes what will be the result of it ?
static void Main(string[] args)
{
int[] array = new[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
Func<int, int> func = i => {
Console.Write(array[i]);
return i;
};
var result = array.Where(e => e <= func(2)).ToArray ();
}
* There is a second part for this question, but only after you answer the first one.
Related posts:C# Inheritance QuestionC# The “double” troubleC# Byte Iteration Question
[ Read the rest of the story in the original article... ]
Related Articles:(This is an automated generated content. If you are the owner of this article and don't want to show this here, just write me at post@12n3.net and I'll remove it immediatly)