C# 7 Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This quick C# 7 guide is a condensed code and syntax reference to the C# programming language, updated with the latest features of C# 7.3 for .NET and Windows 10. It presents the essential C# 7 syntax in a well-organized format that can be used as a handy reference. In the C# 7 Quick Syntax Reference, you will find a concise reference to the C# language syntax: short, simple, and focused code examples; a well laid out table of contents; and a comprehensive index allowing easy review. You won’t find any technical jargon, bloated samples, drawn-out history lessons, or witty stories. What you will find is a language reference that is concise, to the point, and highly accessible. The book is packed with useful information and is a must-have for any C# programmer. What You Will Learn Discover what's new in C# 7.3 and .NET for Windows 10 programming, including out values, ref locals and returns, local functions, throw exceptions, and numeric literals Create lightweight, unnamed types that contain multiple public fields Create branching logic based on arbitrary types and values of the members of those types Nest functions inside other functions to limit their scope and visibility Throw expressions in code constructs that previously were not allowed Declare methods with the async modifier to return other types in addition to Task Use the new numeric literals found in C# 7.3 to improve readability for numeric constants Who This Book Is For Those with some experience in programming, looking for a quick, handy reference. Some C# or .NET recommended but not necessary.

Author(s): Mikael Olsson
Edition: 2
Publisher: Apress
Year: 2018

Language: English
Pages: 180

Table of Contents
About the Author
About the Technical Reviewer
Introduction
Chapter 1: Hello World
Choosing an IDE
Creating a Project
Hello World
IntelliSense
Chapter 2: Compile and Run
Visual Studio Compilation
Console Compilation
Language Version
Comments
Chapter 3: Variables
Data Types
Declaration
Assignment
Integer Types
Floating-Point Types
Char Type
Bool Type
Variable Scope
Chapter 4: Operators
Arithmetic Operators
Assignment Operators
Combined Assignment Operators
Increment and Decrement Operators
Comparison Operators
Logical Operators
Bitwise Operators
Operator Precedents
Chapter 5: Strings
String Concatenation
Escape Characters
String Compare
String Members
StringBuilder Class
Chapter 6: Arrays
Array Declaration
Array Allocation
Array Assignment
Array Access
Rectangular Arrays
Jagged Arrays
Chapter 7: Conditionals
If Statement
Switch Statement
Goto Statement
Ternary Operator
Chapter 8: Loops
While Loop
Do-while Loop
For Loop
Foreach Loop
Break and Continue
Chapter 9: Methods
Defining Methods
Calling Methods
Method Parameters
Params Keyword
Method Overloading
Optional Parameters
Named Arguments
Return Statement
Value and Reference Types
Pass by Value
Pass by Reference
Ref Keyword
Out Keyword
Local Methods
Chapter 10: Class
Object Creation
Accessing Object Members
Constructor
This Keyword
Constructor Overloading
Constructor Chaining
Initial Field Values
Default Constructor
Object Initializers
Partial Class
Garbage Collector
Destructor
Null Keyword
Nullable Types
Null-Coalescing Operator
Null-Conditional Operator
Default Values
Chapter 11: Inheritance
Object Class
Downcast and Upcast
The is and as Keywords
Pattern Matching
Boxing
Unboxing
Chapter 12: Redefining Members
Hiding Members
Overriding Members
Hiding and Overriding
Sealed Keyword
Base Keyword
Chapter 13: Access Levels
Private Access
Protected Access
Internal Access
Protected Internal Access
Private Protected Access
Public Access
Top-Level Access Levels
Inner Classes
Access Level Guideline
Chapter 14: Static
Accessing Static Members
Static Methods
Static Fields
Static Classes
Static Constructor
Extension Methods
Chapter 15: Properties
Property Advantages
Read-Only and Write-Only Properties
Property Access Levels
Auto-Implemented Properties
Chapter 16: Indexers
Indexer Parameters
Indexer Overloading
Chapter 17: Interfaces
Interface Signatures
Interface Example
Functionality Interface
Class Interface
Chapter 18: Abstract
Abstract Members
Abstract Example
Abstract Classes and Interfaces
Chapter 19: Namespaces
Nested Namespaces
Namespace Access
Using Directive
Chapter 20: Enum
Enum Example
Enum Constant Values
Enum Constant Type
Enum Access Levels and Scope
Enum Methods
Chapter 21: Exception Handling
Try-Catch Statement
Catch Block
Exception Filters
Finally Block
The using Statement
Throwing Exceptions
Chapter 22: Operator Overloading
Operator Overloading Example
Binary Operator Overloading
Unary Operator Overloading
Return Types and Parameters
Overloadable Operators
True and False Operator Overloading
Chapter 23: Custom Conversions
Implicit Conversion Methods
Explicit Conversion Methods
Chapter 24: Struct
Struct Variable
Struct Constructors
Struct Field Initializers
Struct Inheritance
Struct Guideline
Chapter 25: Preprocessors
Preprocessor Syntax
Conditional Compilation Symbols
Conditional Compilation
Diagnostic Directives
Line Directive
Region Directives
Chapter 26: Delegates
Anonymous Methods
Lambda Expressions
Expression Body Members
Multicast Delegates
Delegate Signature
Delegates as Parameters
Chapter 27: Events
Publisher
Event Keyword
Event Caller
Raising Events
Subscriber
Event Handler
Subscribing to Events
Chapter 28: Generics
Generic Methods
Calling Generic Methods
Generic Type Parameters
Default Value
Generic Classes
Generic Class Inheritance
Generic Interfaces
Generic Delegates
Generic Events
Generics and Object
Constraints
Multiple Constraints
Why Use Constraints
Chapter 29: Constants
Local Constants
Constant fields
Readonly
In Parameters
Constant Guideline
Chapter 30: Asynchronous Methods
The async and await Keywords keez
Async return types
Custom async methods
Extended return types
Index