• Complain

Joseph Albahari - C# 8.0 Pocket Reference

Here you can read online Joseph Albahari - C# 8.0 Pocket Reference full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2019, publisher: OReilly Media, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Joseph Albahari C# 8.0 Pocket Reference
  • Book:
    C# 8.0 Pocket Reference
  • Author:
  • Publisher:
    OReilly Media
  • Genre:
  • Year:
    2019
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

C# 8.0 Pocket Reference: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "C# 8.0 Pocket Reference" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Joseph Albahari: author's other books


Who wrote C# 8.0 Pocket Reference? Find out the surname, the name of the author of the book and a list of all author's works by series.

C# 8.0 Pocket Reference — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "C# 8.0 Pocket Reference" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
C# 8.0 Pocket Reference

by Joseph Albahari and Ben Albahari

Copyright 2020 Joseph Albahari and Ben Albahari. All rights reserved.

Printed in Canada.

Published by OReilly Media, Inc. , 1005 Gravenstein Highway North, Sebastopol, CA 95472.

OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com .

  • Editors: Rachel Roumeliotis and Corbin Collins
  • Production Editor: Kristen Brown
  • Copyeditor: Octal Publishing, LLC
  • Proofreader: Christina Edwards
  • Indexer: Judy McConville
  • Interior Designer: David Futato
  • Cover Designer: Karen Montgomery
  • Illustrator: Rebecca Demarest
  • November 2019: First Edition
Revision History for the First Edition
  • 2019-10-24: First Release

See https://oreil.ly/c8pr_errata for release details.

The OReilly logo is a registered trademark of OReilly Media, Inc. C# 8.0 Pocket Reference, the cover image, and related trade dress are trademarks of OReilly Media, Inc.

The views expressed in this work are those of the authors, and do not represent the publishers views. While the publisher and the authors have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the authors disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights.

978-1-492-05121-3

[MBP]

C# 8.0 Pocket Reference

C# is a general-purpose, type-safe, object-oriented programming language, the goal of which is programmer productivity. To this end, the language balances simplicity, expressiveness, and performance. C# 8 is designed to work the Microsoft .NET Core 3 runtime, and .NET Standard 2.1 (whereas C# 7 was designed to work with the Microsoft .NET Framework 4.6/4.7/4.8 as well as .NET Core 2.x and .NET Standard 2.0).

Note

The programs and code snippets in this book mirror those in Chapters 2 through 4 of C# 8.0 in a Nutshell and are all available as interactive samples in LINQPad. Working through these samples in conjunction with the book accelerates learning in that you can edit the samples and instantly see the results without needing to set up projects and solutions in Visual Studio.

To download the samples, click the Samples tab in LINQPad and then click Download more samples. LINQPad is freego to http://www.linqpad.net.

A First C# Program

Here is a program that multiplies 12 by 30 and prints the result, 360, to the screen. The double forward slash indicates that the remainder of a line is a comment:

using System; // Importing namespaceclass Test // Class declaration{ static void Main() // Method declaration { int x = 12 * 30; // Statement 1 Console.WriteLine (x); // Statement 2 } // End of method} // End of class

At the heart of this program lie two statements. Statements in C# execute sequentially and are terminated by a semicolon. The first statement computes the expression12 * 30 and stores the result in a local variable, named x, which is an integer type. The second statement calls the Console classs WriteLinemethod, to print the variable x to a text window on the screen.

A method performs an action in a series of statements, called a statement blocka pair of braces containing zero or more statements. We defined a single method named Main.

Writing higher-level functions that call upon lower-level functions simplifies a program. We can refactor our program with a reusable method that multiplies an integer by 12, as follows:

using System;class Test{ static void Main() { Console.WriteLine (FeetToInches (30)); // 360 Console.WriteLine (FeetToInches (100)); // 1200 } static int FeetToInches (int feet) { int inches = feet * 12; return inches; }}

Areturn types method can receive input data from the caller by specifying parameters, and output data back to the caller by specifying a return type. In the preceding example, we defined a method called FeetToInches that has a parameter for inputting feet, and a return type for outputting inches, both of type int (integer).

The literals30 and 100 are the arguments passed to the FeetToInches method. The Main method in our example has empty parentheses because it has no parameters and is void because it doesnt return any value to its caller. C# recognizes a method called Main as signaling the default entry point of execution. The Main method can optionally return an integer (rather than void) in order to return a value to the execution environment. The Main method can also optionally accept an array of strings as a parameter (that will be populated with any arguments passed to the executable). For example:

static int Main (string[] args) {...}
Note

An array (such as string[]) represents a fixed number of elements of a particular type (see ).

Methods are one of several kinds of functions in C#. Another kind of function we used was the *operator, which performs multiplication. There are also constructors, properties, events, indexers, and finalizers.

In.

At the outermost level of a program, types are organized into namespaces. The using directive makes the System namespace available to our application to use the Console class. We could define all of our classes within the TestPrograms namespace, as follows:

using System;namespace TestPrograms{ class Test {...} class Test2 {...}}

The .NET Core libraries are organized into nested namespaces. For example, this is the namespace that contains types for handling text:

using System.Text;

The using directive is there for convenience; you can also refer to a type by its fully qualified name, which is the type name prefixed with its namespace, such as System.Text.StringBuilder.

Compilation

The C# compiler compiles source code, specified as a set of files with the .cs extension, into an assembly, which is the unit of packaging and deployment in .NET. An assembly can be either an application or a library, the difference being that an application has an entry point (Main method), whereas a library does not. The purpose of a library is to be called upon (referenced) by an application or other libraries. The .NET Core runtime (and the .NET Framework) comprise a set of libraries.

To invoke the compiler, you can either use an integrated development environment (IDE) such as Visual Studio or Visual Studio Code, or call it manually from the command line. To manually compile a console application with .NET Core, first download the .NET Core SDK, and then create a new project, as follows:

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «C# 8.0 Pocket Reference»

Look at similar books to C# 8.0 Pocket Reference. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «C# 8.0 Pocket Reference»

Discussion, reviews of the book C# 8.0 Pocket Reference and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.