C#语言参考手册.docx
《C#语言参考手册.docx》由会员分享,可在线阅读,更多相关《C#语言参考手册.docx(251页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、C# Language ReferenceOwners:Anders Hejlsberg and Scott WiltamuthFile:C# Language Reference.docLast saved:1/2/2013Last printed: 1/2/2013Version 0.17bNoticeThis documentation is an early release of the final documentation, which may be changed substantially prior to final commercial release, and is in
2、formation of Microsoft Corporation.This document is proxided for informational purposes only and Microsoft makes no warranties, either express or implied, in this document. Information in this document is subject to change without notice.The entire risk of the use or the results of the use of this d
3、ocument remains with the user. Complying with all applicable copyright laws is the responsibility of the user.Without limiting the rights under copyright, no part of this doaiment may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electron
4、ic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation.Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except
5、as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property.Unpublished work. 1999-2000 Microsoft Corporation. All rights reserved.Microsoft, Windows, Vis
6、ual Basic, and Visual C+ are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A, and/or other countries.Other product and company names mentioned herein may be the trademarks of their respective owners.Table of Contents1. Introduction11.1 Hello, world11.2 Automatic memo
7、ry management21.3 Types41.4 Prlefined types51.5 Array types71.6 Type system unification91.7 Statements101.7.1 Statement lists and blocks101.7.2 Labeled statements and got o statements101.7.3 Local declarations of constants and variables111.7.4 Expression statements111.7.5 The if statement111.7.6 The
8、 switch statement121.7.7 The while statement121.7.8 The do statement131.7.9 The fbr statement131.7.10 The f or each statement131.7.11 The break statement and the cont i nue statement141.7.12 The return statement141.7.13 The throw statement141.7.14 The t r y statement141.7.15 The checked and unchecke
9、d statements141.7.16 The I oc k statement141.8 Classes141.9 Structs151.10 Interfaces151.11 Delegates171.12 Enums181.13 Namespaces181.14 Properties191.15 Indexers201.16 Events211.17 Versioning222. Lexical structure272.1 Phases of translation272.2 Grammar notation272.3 Pre-processing282.3.1 Pre-proces
10、sing declarations282.3.2 #if, #elif, #clse, #endif292.3.3 Pre-processing control lines302.3.4 #line312.3.5 Pre-processing identifiers312.3.6 Pre-processing expressions312.3.7 Interaction with white space322.4 Lexical analysis332.4.5 White space332.5 Processing of Unicode character escape sequences34
11、2.5.1 Literals362533 Reaf literals372.5.2 Operators and punctuators403. Basic concepts3.1 Members3.1.1 Namespace members3.1.2 Struct members3.1.3 Enumeration members3.1.4 Class members3.1.5 Interface members3.1.6 Array members3.1.7 Delegate members3.2 Member access3.2.1 Declared accessibility3.2.2 A
12、ccessibility domains3.2.3 Protected access3.2.4 Accessibility constraints3.3 Signatures and overloading3.4 Scopes3.4.1 Name hiding3.4.1.1 Hiding through nesting.3.4.1.2 Hiding through inheritan)3.5 Namespace and type names3.5.1 Fully qualified names4. Types4.1 Value types4.1.1 Default constructors4.
13、1.2 Struct types4.1.3 Simple types4.1.4 Integral types4.1.5 Floating point types4.1.6 The decimal type4.1.7 The bool type4.1.8 Enumeration types43434344444444444444454748495052525354554.2 Reference types4.2.1 Class types4.2.2 The object type4.2.3 The string type4.2.4 Interface types4.2.5 Array types
14、4.2.6 Delegate types4.3 Boxing and unboxing.4.3.1 Boxing conversions.4.3.2 Unboxing conversions5.1.2 Instance variables675.1.2.2 Instance variables instructs685.1.5 Reference parameters686. Conversions736.1 Implicit conversions736.1.1 Identity conversion736.1.2 Implicit numeric conversions736.1.3 Im
15、plicit enumeration conversions746.1.4 Implicit reference conversions746.1.6 Implicit constant expression conversions746.2.1 Explicit numeric conversions756.2.2 Explicit enumeration conversions766.2.4 Unboxing conversions776.2.5 User-defined explicit conversions776.3.1 Standard implicit conversions77
16、6.3.2 Standard explicit conversions786.4 User-defined conversions786.4.1 Permitted user-defined conversions786.4.2 Evaluation of user-defined conversions786.4.3 User-defined implicit conversions796.4.4 User-defined explicit conversions 80817. Expressions7.2.1 Operator precedence and associativity *7
17、.2.3 Unary operator overload resolution* .7.2.4 Binary operator overload resolution 7.2.5 Candidate user-defined operators7.2.6.1 Una.ry numeric promotions7.3 Member lookup7.4.2.1 Applicable function member *.7.4.2.2 Better iu net ion member-.l.-7.4.3 Function member invocation7.4.3.1 Invocations on
18、 boxed instances7.4.4 Virtual function member lookup7.4.5 Interface function member lookup7.5.2.】 Invariant meaning in blocks7.5.4.1 Identical simple names and type names7.5.6.2 Indexer access7.5.8 Base access7.5.9 Postfix increment and decrement operators 1.1.10.1 Object creation expressions1.1.10.
19、2 Array creation expressions1.1.10.3 Delegate creation expressions7.5 . 13 checked and unchecked operators.,.八.*.55566677 9 11222344444566889 9 00 01122 G 346788001 - 888888 8 8 8.9 99999999999999999 0-0000 0 0000000011117.6 Unary expressions7.6.1 Bitwise complement opemtor Ill7.6.7 Prefix increment
20、 and decrement operatois. *1127 *6-8 C*ast express ions.+.4.+.*+.*+.+*+*+.+*.+4*+.*.+*.*4.+.*.1137.7.1 Multiplication operator1137.7.2 Division operator1147.7.4 Addition operator.1167.7.5 Subtraction operator 1177.9 Relational operators1197.9.2 Floating-point comparison operators 1217.9.3 Decimal co
21、mparison operators 1217.9.4 Boolean equality operators. 1227.9.5 Enumeration comparison operators 1227.9.6 Reference type equality operators 1227.9.7 String equality operators 1237.9.8 Delegate equality operators. 1247.9.9 The is operator1241.1.1 1 Integer logical operators 1241.1.3 3 Boolean logica
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- C# 语言 参考手册
限制150内