Exceptions - Causes of exceptions
Exceptions Exceptions in C# provide a structured, uniform, and type-safe way of handling both system level and application level error conditions. The exception mechanism is C# is quite similar to that of C++, with a few important differences:Citeste tot ... 893 cuvinte
Dimensiune mica - fara poza |
|
|
The lock statement
The lock statement The lock statement obtains the mutual-exclusion lock for a given object, executes a statement, and then releases the lock. lock-statement: lock ( expression ) embedded-statement The expression of a lock statCiteste tot ... 122 cuvinte
Dimensiune mica - fara poza |
|
|
Delegates - Delegate declarations
Delegates Delegates enable scenarios that other languages—such as C++, Pascal, and Modula—have addressed with function pointers. Unlike C++ function pointers, delegates are fully object oriented; unlike C++ pointers to member functions, delegatCiteste tot ... 1169 cuvinte
Dimensiune mica - fara poza |
|
|
Tokens - Unicode character escape sequences
Tokens There are several kinds of tokens: identifiers, keywords, literals, operators, and punctuators. White space and comments are not tokens, though they may act as separators for tokens. token: identifier keyword integer-literal real-Citeste tot ... 2065 cuvinte
Dimensiune medie - fara imagini |
|
|
Operators - Operator precedence and associativity
Operators Expressions are constructed from operands and operators. The operators of an expression indicate which operations to apply to the operands. Examples of operators include +, -, *, /, and new. Examples of operands include literals, fielCiteste tot ... 2257 cuvinte
Dimensiune medie - fara imagini |
|
|
Compilation units
Compilation units A compilation-unit defines the overall structure of a source file. A compilation unit consists of zero or more using-directives followed by zero or more attributes followed by zero or more namespace-member-declarations. compCiteste tot ... 187 cuvinte
Dimensiune mica - fara poza |
|
|
Using directives
Using directives Using directives facilitate the use of namespaces and types defined in other namespaces. Using directives impact the name resolution process of namespace-or-type-names (§3.8) and simple-names (§7.5.2), but unlike dCiteste tot ... 903 cuvinte
Dimensiune mica - fara poza |
|
|
Interfaces - declarations, Interface members
Interfaces An interface defines a contract. A class or struct that implements an interface must adhere to its contract. An interface may inherit from multiple base interfaces, and a class or struct may implement multiple interfaces. InterfacCiteste tot ... 3174 cuvinte
Dimensiune medie - fara imagini |
|
|
Implicit conversions
Implicit conversions The following conversions are classified as implicit conversions: Identity conversions Implicit numeric conversions Implicit enumeration conversions. Implicit reference conversions Boxing conversions ImpliCiteste tot ... 545 cuvinte
Dimensiune mica - fara poza |
|
|
Enums - declarations, Enums members
Enums An enum type is a distinct type that declares a set of named constants. The example enum Color declares an enum type named Color with members Red, Green, and Blue. Enum declarations An enum declaration declares a new eCiteste tot ... 891 cuvinte
Dimensiune mica - fara poza |
|
|
Signatures and overloading
Signatures and overloading Methods, instance constructors, indexers, and operators are characterized by their signatures: The signature of a method consists of the name of the method and the type and kind (value, reference, or output) of eaCiteste tot ... 316 cuvinte
Dimensiune mica - fara poza |
|
|
Selection statements
Selection statements Selection statements select one of a number of possible statements for execution based on the value of an expression. selection-statement: if-statement switch-statement The if statement The if statement selectsCiteste tot ... 1098 cuvinte
Dimensiune mica - fara poza |
|
|
Jump statements
Jump statements Jump statements unconditionally transfer control. jump-statement: break-statement continue-statement goto-statement return-statement throw-statement The location to which a jump statement transfers control is called thCiteste tot ... 1637 cuvinte
Dimensiune medie - fara imagini |
|
|
Declarations
Declarations Declarations in a C# program define the constituent elements of the program. C# programs are organized using namespaces (§9), which can contain type declarations and nested namespace declarations. Type declarations (§Citeste tot ... 721 cuvinte
Dimensiune mica - fara poza |
|
|
Namespace and type names
Namespace and type names Several contexts in a C# program require a namespace-name or a type-name to be specified. Either form of name is written as one or more identifiers separated by “.” tokens. namespace-name: namespace-or-type-nameCiteste tot ... 571 cuvinte
Dimensiune mica - fara poza |
|
|
Blocks
Blocks A block permits multiple statements to be written in contexts where a single statement is allowed. block: A block consists of an optional statement-list (§8.2.1), enclosed in braces. If the statement list is omitted, the bCiteste tot ... 291 cuvinte
Dimensiune mica - fara poza |
|
|
Properties
Properties A property is a member that provides access to a characteristic of an object or a class. Examples of properties include the length of a string, the size of a font, the caption of a window, the name of a customer, and so on. PropertieCiteste tot ... 2237 cuvinte
Dimensiune medie - fara imagini |
|
|
Grammar - Lexical and Syntactic grammar
Grammar This appendix contains summaries of the lexical and syntactic grammars found in the main document, and of the grammar extensions for unsafe code. Grammar productions appear here in the same order that they appear in the main document.Citeste tot ... 1011 cuvinte
Dimensiune mica - fara poza |
|
|
Grammars - Grammar notation
Grammars This specification presents the syntax of the C# programming language using two grammars. The lexical grammar (§2.2.2) defines how Unicode characters are combined to form line terminators, white space, comments, tokens, and pre-Citeste tot ... 403 cuvinte
Dimensiune mica - fara poza |
|
|
Program termination
Program termination Program termination returns control to the execution environment. If the return type of the program’s entry point method is int, the value returned serves as the program's termination status code. The purpose of this codCiteste tot ... 107 cuvinte
Dimensiune mica - fara poza |
|
|
Alte pagini