Home
Browse all 647 examples
Download all 647 examples
Download sample chapters
Reviews
Errata
Acknowledgments
Links on .NET
Paradoxal Press
Buy directly from Paradoxal Press at $33.99 (Save 43%)
Category: Programming
Level: Beginner to seasoned
900 pages
ISBN-10 097661322-0
ISBN-13 978-097661322-0
$59.99 USA
$79.99 CANADA
|
Chapter 10: The .NET 2 type system from a C#2 point of view
Chapter 9< > Chapter 11
Listings: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
Table of content:
The storage of objects in memory Allocating and deallocating objects Managed thread stack Managed heap Object storage: Managed thread stack vs. managed heap Static allocation vs dynamic allocation
Reference types vs. Value types
Understanding references
The Common Type System (CTS) .NET types are not related to any programming language CTS: The big picture
The System.Object class
Comparing objects Equivalence vs. Identity Customizing equality comparison Equality and hash tables Customizing ordering comparison
Cloning an object
Boxing and Unboxing Boxing Some dangerous issues with boxing Unboxing
Primitive types
Integer types
Real types
The bool type
The char type
Conversions between integers and characters
Operations on primitive types Arithmetic on operands of the same primitive type Dealing with the divide by zero issue
Dealing with overflows
Operator priority The pre and post increment/decrement operators Arithmetic operations on different primitive types Operations on bits
Structures
Enumerations
Enumerations and integer types The System.Enum class Bit fields (set of flags)
Strings
The System.String class Strings constants Verbatim string literals Working with strings Formatting strings The System.Text.StringBuilder class
Delegate classes and delegate objects
Introduction Delegate objects and static methods The C#2 compiler can infer a delegate class Delegate objects and instance methods Referencing several methods from a single delegate object The System.Delegate class Modifying the list of referenced methods
Nullable types Value types and null value paradigm The System.Nullable<T> structure Evolution of the C# syntax: Nullable<T> and the null keyword Evolution of the C# syntax: equivalence between Nullable<T> and T? No special treatment for bool? in C# 2.0 Nullables types and boxing/unboxing Nullable structures and enumerations
Partial types
Type declaration elements that must be repeated in each partial declaration Type declaration elements that can optionally be repeated in each partial declaration Type declaration elements that cumulate their effects when repeated in several partial declarations Type declaration elements that only have a local effect on a partial declaration
Copyright Patrick Smacchia 2006 2007
|