C# Entry Point
Bhathiya Bandara
Associate Software Engineer @PayMedia | BSc (Hons) in Electronics & IT (Colombo) | FinTech | Software Architecture Enthusiast | Blogger
The entry point is a crucial starting point for a C# program, and it is important to have a clear understanding of its role in the program's execution. I am going to provide simple explanations of C# syntax in the entry point.
using: use to import namespaces
System: A fundamental namespace that contains types and members that are commonly used.
class: A blueprint for creating objects that share the same properties and methods. Use to encapsulate data and behavior into a single unit.
Main: The entry point for a C# program executing and also the name of the method.
static: Allows to the Main method to be called without an object of the class being created.
void: Use to make the Main method does not return any value.
string[] args: An array of strings that holds any command-line arguments passed to the program.
Console: A type that represents the standard input, output, and error streams for console applications. It is part of the System namespace.
WriteLine: A method of the Console type that writes a string to the console output in a newline.
"Hello, world!" : A string literal that going to write to the console.
# Command line arguments are optional and are separated by spaces. They are useful for passing information to a program at runtime.
# Naming conventions in C#