Conversational C# for Java Programmers

Microsoft introduced C# during June of 2000 as a "modern, object-oriented programming language built from the ground up to exploit the power of XML-based Web services on the .NET platform."

Its chief architect for C#, Anders Hejlsberg, has apparently had the main goal of designing a language that is both object- and component-oriented (software written in C# is meant to be used by other software) and has looked at other languages for guidance on how to do this. Luckily for Java programmers, two of the languages studied were C++ and Java -- so any Java programmer will immediately feel familiar reading and writing C# code as the fundamental concepts and syntaxes are very similar.

The two of them side by side

The best way for a Java programmer to get his crash course in C# is probably to translate a toy Java project into that language. Let's do just that -- starting with Hello.java.

Is C# really Java.NET? If so, what are your thoughts regarding the importance of understanding this from the perspective of a .NET developer as well as even a Java developer new to C#?Post your comments

This is a modified version of the second Java program I wrote when I was first learning Java (the first being the requisite "Hello World"). It's a pretty trivial program, as all it does is say "Hello <name>, welcome to Java," where it gets the name either off the command line of the program or by asking the user for his name when it is first run.

Now let's do the same thing in C# in a file named Hello.cs (this code has been written and compiled with the Microsoft.NET SDK Beta 1).