• Complain

Gerard Byrne - Target C#: Simple Hands-On Programming with Visual Studio 2022

Here you can read online Gerard Byrne - Target C#: Simple Hands-On Programming with Visual Studio 2022 full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2022, publisher: Apress, genre: Home and family. 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.

Gerard Byrne Target C#: Simple Hands-On Programming with Visual Studio 2022
  • Book:
    Target C#: Simple Hands-On Programming with Visual Studio 2022
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2022
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Target C#: Simple Hands-On Programming with Visual Studio 2022: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Target C#: Simple Hands-On Programming with Visual Studio 2022" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

So, you want to learn C# and Visual Studio 2022, but are a bit intimidated? Dont be. Programming is within your grasp! Programmers at any level have to fully understand, and more importantly, be able to code the core constructs. It is impossible to use complex programming concepts such as classes before understanding what methods and variables and their data types are. Once there is a foundation built on the basics, then all other topics can fall in line.

While it is a forgone conclusion that languages change with the introduction of new features, the core concepts do not. Even large enterprises do not always update to the latest versions of languages and frameworks; their backbone applications have been developed to work, regardless. More than ever, enterprises need developers who can master and apply the core programming concepts and then be up-skilled with newer language levels and features as they integrate into the company.

This book builds from the ground up. You will begin with an introduction to programming, learning the foundational concepts needed to become a C# programmer. You will then put to practice a wide range of programming concepts, including data types, selection, iteration, arrays, methods, classes and objects, serialization, file handling, and string handling. You will learn enough to develop applications that emulate commercial application code. Once youve got the foundational concepts, get ready to dive into common programming routines, including linear search, binary search, bubble sort and insertion sort, and use C# to code them. Code example annotations supplement the learning and are designed to enhance learning while also explaining why the code does what it does. This book:

  • Teaches core programming through well-explained and simple-to-follow instructions
  • Reinforces programming skills through the use of coding examples that extend user learnings
  • Explains theoretical programming concepts; applies them practically with code examples
  • Introduces the latest Microsoft C# Integrated Development Environment (Visual Studio 2022)
  • Enlists clear, precise, and easy-to-understand language to assist readers of all levels and experience
  • Uses a mix of theory and practical information that is designed to be friendly and engaging

Who This Book Is For

Beginners, those refreshing their C# skills, or those moving from another programming language. No skills or previous knowledge is required. Readers will need to download Visual Studio 2022 Community Edition as this is what the book code has been based on, but they could use other Integrated Development Environments.

Gerard Byrne: author's other books


Who wrote Target C#: Simple Hands-On Programming with Visual Studio 2022? Find out the surname, the name of the author of the book and a list of all author's works by series.

Target C#: Simple Hands-On Programming with Visual Studio 2022 — 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 "Target C#: Simple Hands-On Programming with Visual Studio 2022" 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

Target C Simple Hands-On Programming with Visual Studio 2022 Gerard - photo 1Target C#Simple Hands-On Programmingwith Visual Studio 2022Gerard ByrneTarget C#: Simple Hands-On Programming with Visual Studio 2022 Gerard Byrne Belfast, Ireland ISBN-13 (pbk): 978-1-4842-8618-0 ISBN-13 (electronic): 978-1-4842-8619-7 https://doi.org/10.1007/978-1-4842-8619-7 Copyright 2022 by Gerard Byrne This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made.

The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Joan Murray Development Editor: Laura Berendson Coordinating Editor: Jill Balzano Cover designed by eStudioCalamar Cover image designed by Freepik (www.freepik.com) Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@ springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail booktranslations@springernature.com; for reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com.

Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub (https://github.com/Apress). For more detailed information, please visit http://www.apress.com/source- code. Printed on acid-free paper My book is dedicated to Maura, Ryan, and Peter.Table of Contents About the Author xv Acknowledgments xvii Introduction xix Chapter 1: NET 1 .

NET: What Is It? ............................................................................................................................ 1 . NET Core: What Is It? .................................................................................................................... 2 C# Language Versioning ................................................................................................................ 3 . 5 Compile Time and Runtime ........................................................................................................... 6 Framework and Library ................................................................................................................. 7 Library ..................................................................................................................................... 7 Framework .............................................................................................................................. 8 Managed and Unmanaged Code ................................................................................................. 10 Chapter Summary ....................................................................................................................... 10 Chapter 2: Software Installation 13 About the .NET Framework ......................................................................................................... 13 Installing the .NET Framework .............................................................................................. 14 Installing Visual Studio .......................................................................................................... 21 Chapter Summary ....................................................................................................................... 25 Chapter 3: Introduction 27 Computer Program ...................................................................................................................... 27 Programming Languages ...................................................................................................... 28 A Computer Program: A Recipe ............................................................................................. 29 v Table of ConTenTs Type in C# .............................................................................................................................. 32 The Basic Operations of a Computer ..................................................................................... 37 C# Program Application Formats ................................................................................................ 37 Format 1: Console Application ............................................................................................... 37 Format 2: .NET MAUI .............................................................................................................. 39 Format 3: ASP.NET Web Applications ..................................................................................... 40 The Structure of a C# Program ................................................................................................... 40 Namespaces .......................................................................................................................... 46 Classes .................................................................................................................................. 47 Chapter Summary ....................................................................................................................... 50 Chapter 4: Input and Output 53 Write to and Read from the Console ........................................................................................... 53 Change Console Display Settings .......................................................................................... 69 Chapter Summary ....................................................................................................................... 75 Chapter 5: Commenting Code 77 C# Single-Line Comments........................................................................................................... 79 New .NET 6 Templates ................................................................................................................ 84 C# Multiple-Line Comments ........................................................................................................ 89 Chapter Summary ....................................................................................................................... 91 Chapter 6: Data Types 93 Data Types, Variables, and Conversion ........................................................................................ 93 Data Types ............................................................................................................................. 93 Conversion from One Data Type to Another ........................................................................... 96 C# 8 Nullable Reference Types ............................................................................................ 126 Chapter Summary ..................................................................................................................... 140 Chapter 7: Casting and Parsing 143 Data Types, Casting, and Parsing .............................................................................................. 143 Chapter Summary ..................................................................................................................... 157 vi Table of ConTenTs Chapter 8: Arithmetic 159 Arithmetic Operations ............................................................................................................... 159 Common Arithmetic Operators ............................................................................................ 161 Integer Division .................................................................................................................... 162 Solution Explorer and Project Analysis ................................................................................ 166 Chapter Summary ..................................................................................................................... 192 Chapter 9: Selection 195 Arithmetic Operations ............................................................................................................... 195 Selection .............................................................................................................................. 195 Comparison Operators ......................................................................................................... 196 The switch Construct ........................................................................................................... 217 The switch Construct Using when ....................................................................................... 225 switch with Strings .............................................................................................................. 231 switch with Strings .............................................................................................................. 239 Logical Operators ................................................................................................................ 247 Using the AND Operator ....................................................................................................... 249 Using the OR Operator ......................................................................................................... 255 Using the NOT Operator ....................................................................................................... 260 Conditional Operator (Ternary Operator) .............................................................................. 264 Nested Ternary Conditional Operator ................................................................................... 268 Chapter Summary ..................................................................................................................... 273 Chapter 10: Iteration 275 Iteration and Loops ................................................................................................................... 275 Introduction to Iteration ....................................................................................................... 275 For Loop ............................................................................................................................... 276 While Loop ........................................................................................................................... 298 Do (While) Loop ................................................................................................................... 313 Chapter Summary ..................................................................................................................... 327 vii Table of ConTenTs Chapter 11: Arrays 329 Arrays: A Data Structure ............................................................................................................ 329 Single-Dimensional Arrays .................................................................................................. 332 foreach Loop ........................................................................................................................ 348 Ranges and Indices: C# 8 and Above ................................................................................... 362 Chapter Summary ..................................................................................................................... 372 Chapter 12: Methods 375 Methods: Modularization ........................................................................................................... 375 Methods: Concepts of Methods and Functions .................................................................... 375 Some Points Regarding Methods ........................................................................................ 377 Three Types of Methods....................................................................................................... 381 Void Methods ....................................................................................................................... 382 Value Methods ..................................................................................................................... 397 Parameter Methods ............................................................................................................. 407 Method Overloading ............................................................................................................ 425 C# 7 Local Function ............................................................................................................. 429 C# 8 Static Local Function ................................................................................................... 434 C# 10 Null Parameter Checking ........................................................................................... 437 C# 10 Null Parameter Checking Approach ........................................................................... 441 Chapter Summary ..................................................................................................................... 443 Chapter 13: Classes 447 Classes and Objects in OOP ...................................................................................................... 447 A Class Is a Data Structure .................................................................................................. 448 Constructor .......................................................................................................................... 490 Additional Example for Classes and Objects ....................................................................... 503 Chapter Summary ..................................................................................................................... 521 Chapter 14: Interfaces 523 Interfaces and Abstract Classes ................................................................................................ 523 The Interface or Abstract Class as a Manager ..................................................................... 525 Instantiate the Abstract Class? ............................................................................................ 533 viii Table of ConTenTs Static Members of the Abstract Class ................................................................................. 539 Concept of an Interface ....................................................................................................... 552 Implementing Multiple Interfaces ........................................................................................ 562 Concept of Default Method in an Interface .......................................................................... 582 Concept of Static Methods and Fields in an Interface ......................................................... 590 Chapter Summary ..................................................................................................................... 592 Chapter 15: String Handling 595 String Handling and Manipulation ............................................................................................. 595 String Literals ...................................................................................................................... 597 Substring ............................................................................................................................. 601 Length ................................................................................................................................. 604 StartsWith( ) ......................................................................................................................... 605 Split( ) ................................................................................................................................... 607 CompareTo( ) ........................................................................................................................ 611 ToUpper( ) and ToLower( ) ..................................................................................................... 615 Concat( ) ............................................................................................................................... 616 Trim( ) ................................................................................................................................... 617 Replace( ) ............................................................................................................................. 619 Contains( ) ............................................................................................................................ 621 IndexOf( ) .............................................................................................................................. 622 Insert( ) ................................................................................................................................. 624 String.Format( ) .................................................................................................................... 627 What About $@ or @$? ....................................................................................................... 637 Chapter Summary ..................................................................................................................... 644 Chapter 16: File Handling 647 File Handling ............................................................................................................................. 647 An Overview of File Handling .............................................................................................. 648 File Class ............................................................................................................................. 649 Writing to a File ................................................................................................................... 658 Reading from a File ............................................................................................................. 665 Copy a File ........................................................................................................................... 671 ix Table of ConTenTs Delete a File ......................................................................................................................... 674 StreamReader Class ............................................................................................................ 677 StreamWriter Class .............................................................................................................. 679 Reading from a Stream ....................................................................................................... 680 Writing to a Stream ............................................................................................................. 682 Async Methods and Asynchronous Programming ............................................................... 685 FileStream ........................................................................................................................... 687 Chapter Summary ..................................................................................................................... 691 Chapter 17: Exception Handling 693 Exceptions ................................................................................................................................. 693 What Is an Exception? ......................................................................................................... 693 try ........................................................................................................................................ 696 catch .................................................................................................................................... 697 finally ................................................................................................................................... 699 throw ................................................................................................................................... 699 Multiple Exceptions ............................................................................................................. 704 FileNotFoundException ........................................................................................................ 707 finally ................................................................................................................................... 710 StackTrace ........................................................................................................................... 713 throw ................................................................................................................................... 714 rethrow ................................................................................................................................ 716 Chapter Summary ..................................................................................................................... 725 Chapter 18: Serialization 727 Serialization and Deserialization ............................................................................................... 727 Deserialization ..................................................................................................................... 728 Attribute [NonSerialized] ..................................................................................................... 728 Serializing the Object .......................................................................................................... 738 Deserializing the Serialized File to a Class .......................................................................... 743 Access Modifier [NonSerialized].......................................................................................... 749 x Table of ConTenTs Serialization Using XML ....................................................................................................... 751 Serialization Using JSON ..................................................................................................... 762 Chapter Summary ..................................................................................................................... 770 Chapter 19: Structs 773 Concept of a Struct as a Structure Type .................................................................................... 773 Difference Between Struct and Class .................................................................................. 774 Struct with a Default Constructor Only ................................................................................ 776 Struct with a User Constructor ............................................................................................ 779 Struct Instantiation Without the New Keyword .................................................................... 780 Struct Instantiation with the New Keyword ......................................................................... 781 Creating a Constructor......................................................................................................... 783 Creating Member Properties (Get and Set Accessors) ......................................................... 784 Encapsulation ...................................................................................................................... 788 Readonly Struct ................................................................................................................... 788 Creating a Readonly Struct .................................................................................................. 789 C# 8 readonly Members ...................................................................................................... 793 C# 8 Nullable Reference Types ............................................................................................ 797 Chapter Summary ..................................................................................................................... 802 Chapter 20: Enumerations 803 Concept of Enumerations .......................................................................................................... 803 Defining an Enumeration ..................................................................................................... 804 Enumerated Values: Use and Scope .................................................................................... 806 Enumeration Methods ......................................................................................................... 809 Using the foreach Iteration .................................................................................................. 811 Enumeration Values: GetValues() ......................................................................................... 814 Assigning Our Own Values to the Enumeration ................................................................... 815 Use the GetName() and GetValues() Methods ...................................................................... 817 Sample Application Using Enumerations ............................................................................. 818 Chapter Summary ..................................................................................................................... 830 xi Table of ConTenTs Chapter 21: Delegates 831 Concept of Delegates ................................................................................................................ 831 Single Delegate ................................................................................................................... 835 Multicast Delegates ............................................................................................................. 838 More Complex Example ....................................................................................................... 842 Chapter Summary ..................................................................................................................... 852 Chapter 22: Events 853 Concept of Events ..................................................................................................................... 853 Publisher and Subscriber .................................................................................................... 853 Declare an Event ................................................................................................................. 856 Raise an Event ..................................................................................................................... 857 Handle an Event................................................................................................................... 857 Add a Method to an Event Using += ................................................................................... 864 Refer the Event to a Second Method Using += ................................................................... 865 Refer the Event to a Third Method Using += ....................................................................... 867 Remove a Method from an Event Using -= ......................................................................... 869 Chapter Summary ..................................................................................................................... 870 Chapter 23: Generics 873 Concept of Generics .................................................................................................................. 873 Generic Class, Generic Method, Generic Parameters .......................................................... 877 Generic Class, Generic Method, Mixed Parameter Types ..................................................... 883 Generic Method Only ........................................................................................................... 885 Chapter Summary ..................................................................................................................... 891 Chapter 24: Common Routines 893 Common Programming Routines with C# ................................................................................. 893 Linear Search ...................................................................................................................... 893 Binary Search (Iterative Binary Search) .............................................................................. 900 Bubble Sort .......................................................................................................................... 908 Insertion Sort ....................................................................................................................... 914 Chapter Summary ..................................................................................................................... 922 xii Table of ConTenTs Chapter 25: Programming Labs 923 C# Practice Exercises................................................................................................................ 923 Chapter 4 Labs: WriteLine( ) ................................................................................................. 924 Chapter 6 Labs: Data Types ................................................................................................. 928 Chapter 7 Labs: Data Conversion and Arithmetic ................................................................ 936 Chapter 8 Labs: Arithmetic .................................................................................................. 940 Chapter 9 Labs: Selection .................................................................................................... 942 Chapter 10 Labs: Iteration ................................................................................................... 947 Chapter 11 Labs: Arrays ...................................................................................................... 953 Chapter 12 Labs: Methods ................................................................................................... 959 Chapter 13 Labs: Classes .................................................................................................... 966 Chapter 14 Labs: Interfaces ................................................................................................. 974 Chapter 15 Labs: String Handling ........................................................................................ 977 Chapter 16 Labs: File Handling ............................................................................................ 982 Chapter 17 Labs: Exceptions ............................................................................................... 986 Chapter 18 Labs: Serialization of a Class ............................................................................ 989 Chapter 19 Labs: Structs ..................................................................................................... 996 Chapter 20 Labs: Enumerations......................................................................................... 1002 Chapter 21 Labs: Delegates ............................................................................................... 1011 Chapter 22 Labs: Events .................................................................................................... 1017 Chapter 23 Labs: Generics ................................................................................................. 1026 Chapter Summary ................................................................................................................... 1031 Chapter 26: C# 11 1033 C# New Features ..................................................................................................................... 1033 Raw String Literals ............................................................................................................ 1034 New Lines in String Interpolations .................................................................................... 1042 List Patterns ...................................................................................................................... 1044 Auto Default Struct ............................................................................................................ 1050 Warning Wave 7 ................................................................................................................. 1055 Chapter Summary ................................................................................................................... 1057 Index 1059 xiii About the Author Gerard Byrne is a senior technical trainer for a US-based - photo 2

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Target C#: Simple Hands-On Programming with Visual Studio 2022»

Look at similar books to Target C#: Simple Hands-On Programming with Visual Studio 2022. 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 «Target C#: Simple Hands-On Programming with Visual Studio 2022»

Discussion, reviews of the book Target C#: Simple Hands-On Programming with Visual Studio 2022 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.