Punctuation marks are used in C# as special symbols to group or divide code. It includes -
] () {}, ; * = #
For example, = is included in the class and even when declaring the variable. The statement ends with a semicolon -
int a = 10;
In a class, use curly braces -
class Demo { }
When declaring a dictionary -
var d = new Dictionary<string, int>(5);
It is also used when declaring and initializing a list -
List<string> myList = new List<string>() { "mammals", "reptiles", "amphibians" };
The above is the detailed content of What are punctuation marks in C#?. For more information, please follow other related articles on the PHP Chinese website!