O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Hello C#!

Even before we start off with C# syntax and semantics in Part 2, let's do the traditional "Hello World" example just to warm up. This is Hello World, C# version: [1]

[1] Doesn't this look like Java? This familiarity sure gives some confidence doesn't it? At first glance, the Hello World program makes C# look more 'Java-ish' than 'C-ish', but the differences between C# and Java will become more obvious as we progress.

// HelloWorld.cs
public class TestClass{
  public static void Main (){
    System.Console.WriteLine("Hello C#! Here I come!");
  }
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required