Console.WriteLine ( "Kilroy was here." );One line of code! This builds and runs just fine with C# 12. This would not build with older versions of C# (notably Mono). Having code outside of a class is what they call a "Top level statement" and only became legal as of C# 10.
The truth is that the compiler wraps this in the usual ceremony
(boilerplate code) for you, so you are just in essence "tricking yourself".
But it makes a dandy one line first C# program to use as a teaser.
Tom's Computer Info / tom@mmto.org