C# 9.0 - Optional "Main"
Wriju's Blog
Posted on November 12, 2020
To run a C# code now we don't need namespace, main etc. Just run it
using System;
Console.WriteLine("Hello one line C# 9.0");
//namespace CSharp9
//{
// class Program
// {
// static void Main(string[] args)
// {
// Console.WriteLine("Hello one line C# 9.0");
// }
// }
//}
Even this works
using System;
Console.WriteLine("Hello one line C# 9.0");
Console.WriteLine("Hello one line C# 9.0");
if (1 == 1)
{
Console.WriteLine("if con");
}
💖 💪 🙅 🚩
Wriju's Blog
Posted on November 12, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.