Quantcast
Channel: MSDN Blogs
Viewing all articles
Browse latest Browse all 12366

The longest introduction to C#

$
0
0

Today, I suddenly found my first book about C#. Here is the first C# program from there:

using System;
class Hello
{
public static void Main(string []args)
{
if (args.Length==0)
{
Console.WriteLine("Hello, World");
}
else
{
Console.WriteLine("Hello, " + args[0]);
}
}
}

And here is the first one that we developed with Dmitriy Nikonov in our first module about C#:

using static System.Console;

class Program
{
static void Main(string[] args)
{
WriteLine((args.Length==0) ? "Hello" : $"Hello {args[0]}");
}
}

Try to find any difference.

The first module is here.


Viewing all articles
Browse latest Browse all 12366

Trending Articles