X hits on this document

796 views

0 shares

0 downloads

0 comments

230 / 396

Chapter ‎18   Unsafe code

The declaration includes at most one of the following modifiers: static, virtual, and override.

The declaration includes at most one of the following modifiers: new and override.

If the declaration includes the abstract modifier, then the declaration does not include any of the following modifiers: static, virtual, sealed or extern.

If the declaration includes the private modifier, then the declaration does not include any of the following modifiers: virtual, override, or abstract.

If the declaration includes the sealed modifier, then the declaration also includes the override modifier.

The return-type of a method declaration specifies the type of the value computed and returned by the method. The return-type is void if the method does not return a value.

The member-name specifies the name of the method. Unless the method is an explicit interface member implementation (§‎13.4.1), the member-name is simply an identifier. For an explicit interface member implementation, the member-name consists of an interface-type followed by a “.” and an identifier.

The optional formal-parameter-list specifies the parameters of the method (§‎10.5.1).

The return-type and each of the types referenced in the formal-parameter-list of a method must be at least as accessible as the method itself (§‎3.5.4).

For abstract and extern methods, the method-body consists simply of a semicolon. For all other methods, the method-body consists of a block, which specifies the statements to execute when the method is invoked.

The name and the formal parameter list of a method define the signature (§‎3.6) of the method. Specifically, the signature of a method consists of its name and the number, modifiers, and types of its formal parameters. The return type is not part of a method’s signature, nor are the names of the formal parameters.

The name of a method must differ from the names of all other non-methods declared in the same class. In addition, the signature of a method must differ from the signatures of all other methods declared in the same class, and two methods declared in the same class may not have signatures that differ solely by ref and out.

10.5.1 Method parameters

The parameters of a method, if any, are declared by the method’s formal-parameter-list.

formal-parameter-list: fixed-parameters fixed-parameters   ,   parameter-array parameter-array

fixed-parameters: fixed-parameter fixed-parameters   ,   fixed-parameter

fixed-parameter: attributesopt   parameter-modifieropt   type   identifier

parameter-modifier: ref out

parameter-array: attributesopt   params   array-type   identifier

The formal parameter list consists of one or more comma-separated parameters of which only the last may be a parameter-array.

Copyright Microsoft Corporation 1999-2003. All Rights Reserved.217

Document info
Document views796
Page views796
Page last viewedSat Dec 03 22:23:05 UTC 2016
Pages396
Paragraphs9401
Words133190

Comments