Common · Knowledge

C Sharp syntax

Syntax of the C# programming language

This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.

From Wikipedia

This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono. An identifier is the name of a code element. It can contain letters, digits and underscores (_), and is case sensitive (FOO is different from foo). The language imposes the following restrictions on identifier names: Identifier names may be prefixed by @, which allows the use of reserved keywords as identifiers (for example, @class), but the @ is not considered part of the identifier's name for most purposes; @name and name refer to the same identifier. Microsoft offered naming conventions for identifiers in C#, recommending the use of PascalCase for the names of types and most type members, and camelCase for variables and for private or internal fields. These naming conventions are not enforced by the language. Keywords are words with syntactic meaning. The language has two types of keyword — contextual and reserved. Reserved keywords such as false or byte may only be used as keywords.

Text: Wikipédia, CC BY-SA 4.0. · Image: Lance Zimmerman (Public domain) ·

Open

Tap to close

Confirmation