noimage

TechQuiz Question 1 Why doesn’t my code throw an exception?

Inside VincisAqtion we’ve started with a little TechQuiz. We’re planning on  creating weekly questions to publish them on our intranet and next to the coffee machine. The first question is: Why doesn’t the following code throw an exception? static IEnumerable<char> CapitalLetters(string input){    if (input == null)    {        throw new ArgumentNullException(input);    }    foreach (char c in input)    {        yield return char.ToUpper(c);    }}          static void Main()         {             CapitalLetters(null);         } The code...