Category:Csharp
From CodeWiki
Hello world in C#
C# is an object oriented programming language, so the function must be in a class. The name of the class can be anything, but the function must be called "main". Main can either return int, or be a void function. When creating a console program int is mostly used as this allows the program to return an error to the environment. Main doenst need any parameters or a string array (string[]) that contains the paramaters for the program.
<font color="blue">using</font> System; <font color="blue">public static class</font> Program { <font color="blue">public static void</font> Main() { Console.WriteLine("Hello World!"); } }
This will write "Hello World!" to a console window.
Articles in category "Csharp"
There are 9 articles in this category.
BI |
LSU |
U cont. |
