Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Csharp/examples/StaticUsingCSharp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// use 'static' keyword to do not specifying 'Console' class
using static System.Console;

// use WriteLine() method without specifying 'Console' class
WriteLine("Hello World");

// Include this line to keep the console from closing right after printing "Hello World!" (without specifying 'Console' class)
ReadKey();
9 changes: 9 additions & 0 deletions Csharp/examples/TopLevelStatementCSharp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Console.WriteLine("Hello, World!");
/*System.Console.WriteLine("Hello World!");
can be used if you don't set up
'using System;' at top of file
"At compile time, the compiler injects top-level statements into a generated Main method,
which remains the program's entry point.*/

// Include this line to keep the console from closing right after printing "Hello World!"
Console.ReadKey();