C# Entry Point

C# Entry Point

No alt text provided for this image
NewClass.cs
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#

  • classes: begin with a capital letter and use camel case.
  • method: begin with a capital letter and end with parentheses ()
  • variable: begin with a lowercase letter and use camel case.

要查看或添加评论,请登录

Bhathiya Bandara的更多文章

社区洞察

其他会员也浏览了