Back to questions
JuniorTheoryCommon
What happens when this program is compiled and run?
Console.WriteLine("Start");
console.WriteLine("Finish");It does not compile
- Expecting
Startto print before the error: an unknown name is a compile error, so the program never runs and prints no line at all. - Expecting C# to ignore letter case:
consoleandConsoleare different names, and the compiler knows onlyConsole.
- What error code does the compiler report for
console, and what does its message say? - What does the compiler report if the second line calls
Console.Writelineinstead?