Here’s a cute little puzzler I got from the blog hackification — why the does code below compile?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { https://www.globalnerdy.com System.Console.WriteLine("Hello from Global Nerdy!"); System.Console.WriteLine("(Press ENTER to continue)"); System.Console.ReadLine(); } } } |
Here’s what the output of the program looks like:
Why does the program compile even though the first line of the Main()
method is a “bareword” URL? See if you can figure it out on your own rather than running it through the compiler – doing that gives away the answer.
I’ll post the answer in the comments.