2.5. Summary

You can write C# programs both from the command line and by using the Visual Studio .NET IDE. In its simplest form, a C# application is an EXE file that you create by compiling one or many class files. For the program to execute, you must define an entry point, and a C# EXE file can have only one entry point.

Java programmers should be aware of the following key points.

  • There is no classpath in C#. All the data required to run the EXE file is defined in the EXE file.

  • C# allows multiple public classes in one source file.

  • C# does not require that you give the same name to the class file that you give to the public class in that file.

  • The Main method of C# must be static (just as in Java).

  • C# namespaces are roughly equivalent to Java packages, ...

Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.