Book description
This book presents the C# 5.0 language in a uniquely succinct and visual format. Often in programming books, the information can be hidden in a vast sea of words. As a programmer who has over the years used a dozen programming languages, the author understands it can sometimes be difficult to slog through another 1,000-page book of dense text to learn a new language. There are likely many other programmers who feel the same way. To address this situation, this book explains C# 5.0 using figures; short, focused code samples; and clear, concise explanations.
Figures are of prime importance in this book. While teaching programming seminars, Daniel Solis found that he could almost watch the light bulbs going on over the students' heads as he drew the figures on the whiteboard. In this text, he has distilled each important concept into simple but accurate illustrations. The visual presentation of the content will give you an understanding of C# that's not possible with text alone.
For something as intricate and precise as a programming language, however, there must be text as well as figures. But rather than long, wordy explanations, Solis has used short, concise descriptions and bulleted lists to make each important piece of information visually distinct.
By the end of this book, you'll have a thorough working knowledge of all aspects of the C# language, whether you're a novice programmer or a seasoned veteran of other languages. If you want a long, leisurely, verbose explanation of the language, this is not the book for you. But if you want a concise, thorough, visual presentation of C# 5.0, this is just what you're looking for.
Table of contents
- Title
- Dedication
- Contents at a Glance
- Contents
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
- CHAPTER 1: C# and the .NET Framework
- CHAPTER 2: Overview of C# Programming
- CHAPTER 3: Types, Storage, and Variables
-
CHAPTER 4: Classes: The Basics
- Overview of Classes
- Programs and Classes: A Quick Example
- Declaring a Class
- Class Members
- Creating Variables and Instances of a Class
- Allocating Memory for the Data
- Instance Members
- Access Modifiers
- Accessing Members from Inside the Class
- Accessing Members from Outside the Class
- Putting It All Together
-
CHAPTER 5: Methods
- The Structure of a Method
- Code Execution in the Method Body
- Local Variables
- Local Constants
- Flow of Control
- Method Invocations
- Return Values
- The Return Statement and Void Methods
- Parameters
- Value Parameters
- Reference Parameters
- Reference Types As Value and Reference Parameters
- Output Parameters
- Parameter Arrays
- Summary of Parameter Types
- Method Overloading
- Named Parameters
- Optional Parameters
- Stack Frames
- Recursion
-
CHAPTER 6: More About Classes
- Class Members
- Order of Member Modifiers
- Instance Class Members
- Static Fields
- Accessing Static Members from Outside the Class
- Static Function Members
- Other Static Class Member Types
- Member Constants
- Constants Are Like Statics
- Properties
- Instance Constructors
- Static Constructors
- Object Initializers
- Destructors
- The readonly Modifier
- The this Keyword
- Indexers
- Access Modifiers on Accessors
- Partial Classes and Partial Types
- Partial Methods
-
CHAPTER 7: Classes and Inheritance
- Class Inheritance
- Accessing the Inherited Members
- All Classes Are Derived from Class object
- Masking Members of a Base Class
- Base Access
- Using References to a Base Class
- Constructor Execution
- Inheritance Between Assemblies
- Member Access Modifiers
- Abstract Members
- Abstract Classes
- Sealed Classes
- Static Classes
- Extension Methods
- Naming Conventions
-
CHAPTER 8: Expressions and Operators
- Expressions
- Literals
- Order of Evaluation
- Simple Arithmetic Operators
- The Remainder Operator
- Relational and Equality Comparison Operators
- Increment and Decrement Operators
- Conditional Logical Operators
- Logical Operators
- Shift Operators
- Assignment Operators
- The Conditional Operator
- Unary Arithmetic Operators
- User-Defined Type Conversions
- Operator Overloading
- The typeof Operator
- Other Operators
-
CHAPTER 9: Statements
- What Are Statements?
- Expression Statements
- Flow-of-Control Statements
- The if Statement
- The if...else Statement
- The while Loop
- The do Loop
- The for Loop
- The switch Statement
- Jump Statements
- The break Statement
- The continue Statement
- Labeled Statements
- The goto Statement
- The using Statement
- Other Statements
- CHAPTER 10: Structs
- CHAPTER 11: Enumerations
-
CHAPTER 12: Arrays
- Arrays
- Types of Arrays
- An Array As an Object
- One-Dimensional and Rectangular Arrays
- Instantiating a One-Dimensional or Rectangular Array
- Accessing Array Elements
- Initializing an Array
- Jagged Arrays
- Comparing Rectangular and Jagged Arrays
- The foreach Statement
- Array Covariance
- Useful Inherited Array Members
- Comparing Array Types
-
CHAPTER 13: Delegates
- What Is a Delegate?
- An Overview of Delegates
- Declaring the Delegate Type
- Creating the Delegate Object
- Assigning Delegates
- Combining Delegates
- Adding Methods to Delegates
- Removing Methods from a Delegate
- Invoking a Delegate
- Delegate Example
- Invoking Delegates with Return Values
- Invoking Delegates with Reference Parameters
- Anonymous Methods
- Lambda Expressions
- CHAPTER 14: Events
-
CHAPTER 15: Interfaces
- What Is an Interface?
- Declaring an Interface
- Implementing an Interface
- An Interface Is a Reference Type
- Using the as Operator with Interfaces
- Implementing Multiple Interfaces
- Implementing Interfaces with Duplicate Members
- References to Multiple Interfaces
- An Inherited Member As an Implementation
- Explicit Interface Member Implementations
- Interfaces Can Inherit Interfaces
- Example of Different Classes Implementing an Interface
- CHAPTER 16: Conversions
-
CHAPTER 17: Generics
- What Are Generics?
- Generics in C#
- Generic Classes
- Declaring a Generic Class
- Creating a Constructed Type
- Creating Variables and Instances
- Constraints on Type Parameters
- Generic Methods
- Extension Methods with Generic Classes
- Generic Structs
- Generic Delegates
- Generic Interfaces
- Covariance
- Contravariance
- CHAPTER 18: Enumerators and Iterators
- CHAPTER 19: Introduction to LINQ
- CHAPTER 20: Introduction to Asynchronous Programming
- CHAPTER 21: Namespaces and Assemblies
- CHAPTER 22: Exceptions
- CHAPTER 23: Preprocessor Directives
- CHAPTER 24: Reflection and Attributes
- CHAPTER 25: Other Topics
- Index
Product information
- Title: Illustrated C# 2012
- Author(s):
- Release date: July 2012
- Publisher(s): Apress
- ISBN: 9781430242789
You might also like
book
Start Here!™: Learn Microsoft® Visual C#® 2010
Ready to learn programming? Start Here! Learn the fundamentals of modern programming with Visual C# 2010—and …
book
A Letter to My White Friends and Colleagues
Learn how to address racial wealth disparity in the United States today From the life, professional …
book
From Arsenic to Zirconium
Indulge your love of the periodic table with this collection of poems and fun facts about …
book
CSS3 Quick Syntax Reference: A Pocket Guide to the Cascading Style Sheets Language
The CSS3 Quick Syntax Reference is a 150-page syntax reference to the Cascading Style Sheets language. …