03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CONTENTS<br />

Comments 43<br />

End-of-line and Multiline Comments 43<br />

XML Comments 45<br />

Summary 48<br />

Exercises 48<br />

Part II: <strong>C#</strong> Language Elements<br />

Chapter 4: Data Types, Variables, and Constants 53<br />

Data Types 54<br />

Value Versus <strong>Reference</strong> Types 57<br />

The var Keyword 58<br />

Variable Declaration Syntax 59<br />

Name 62<br />

Attributes 62<br />

Accessibility 63<br />

Static, Constant, and Volatile Variables 64<br />

Initialization 65<br />

Classes and Structures 66<br />

Arrays 67<br />

Collections 68<br />

Literal Type Characters 69<br />

Data Type Conversion 72<br />

Implicit Conversion 73<br />

Casting 74<br />

Using the as Operator 76<br />

Casting Arrays 77<br />

Parsing 77<br />

Using System.Convert 78<br />

Using System.BitConverter 78<br />

ToString 79<br />

Scope 79<br />

Block Scope 79<br />

Method Scope 80<br />

Class Scope 81<br />

Restricting Scope 81<br />

Parameter Declarations 82<br />

By Value 82<br />

By <strong>Reference</strong> 83<br />

For Output 84<br />

Unusual Circumstances and Exceptions 85<br />

xvi<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!