If you're using the command-line option, open a command window now and type HelloWorld at the command prompt where you built the application. The output should be similar to this: -
d:\>HelloWorld Hello, World
If, on the other hand, you're attempting to run the application from an editor and either you do not see anything or a command prompt pops up, runs the application, and disappears quickly, alter your code as follows: -
class HelloWorld { public static void Main() { System.Console.WriteLine("Hello, World"); String str = System.Console.ReadLine(); } }
The call to System.Console.ReadLine will cause the application to pause until you've pressed the Enter key, thereby giving you the opportunity to see that the application has printed what you were expecting. From here on, the demos in this tutorial will not contain this line of code. If you're using an editor to run these demos, you'll need to remember to insert this line before the end of each application.