C# Programming
125 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris

Découvre YouScribe en t'inscrivant gratuitement

Je m'inscris
Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus
125 pages
English

Vous pourrez modifier la taille du texte de cet ouvrage

Obtenez un accès à la bibliothèque pour le consulter en ligne
En savoir plus

Description

C# Programming: This book is specially written for Microsoft's .Net Developers in Computer Engineering and Information Technologies fields. Also those who are interested learning C#.Net can refer this book gain knowledge about power of C# for development of various .Net applications.

It covers virtually most of core features and some of the advanced features of C# Programming for dynamic website development including more than hands on examples tested through .NET. Most of code samples are presented in easy to use way through any simple text editor starting from notepad to rich editor like Microsoft Visual Studio.Net. Throughout the book most of the programming features are explained through syntax and examples to develop state-of-the-art Windows and Web applications using advanced concepts like Threading, GUI and other authentication features.

Sujets

Informations

Publié par
Date de parution 21 février 2013
Nombre de lectures 2
EAN13 9781456611934
Langue English

Informations légales : prix de location à la page 0,0500€. Cette information est donnée uniquement à titre indicatif conformément à la législation en vigueur.

Extrait

C# Programming
By Jitendra Patel

Overview
C# Programming: This book is specially written for Microsoft's .Net Developers in Computer Engineering and Information Technologies fields. Also those who are interested learning C#.Net can refer this book gain knowledge about power of C# for develpoment of various .Net applications.
It covers virtually most of core features and some of the advanced features of C# Programming for dynamic website development including more than hands on examples tested through .NET. Most of code samples are presented in easy to use way through any simple text editor starting from notepad to rich editor like Microsoft Visual Studio.Net. Throughout the book most of the programming features are explained through syntax and examples to develop state-of-the-art Windows and Web applications using advanced concepts like Threading, GUI and other authentication features.
Copyright © 2012 Jitendra Patel
No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an "as is" basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Dedication
This book is dedicated to my honorable parents and beloved students who are my favorite person in the world.
PREFACE
I want to thank a number of people at my institute for helping us solve the difficulties of book and finding the solution of various critical problems I faced during writing the development.
As the reader of this book, you are my most important critic and commentator. I value your opinion and want to know what I am doing right, what I could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass my way.
As an author of this book, I welcome your comments. You can email or write me directly to let me know what you did or didn't like about this book as well as what I can do to make the book better.
When you write, please be sure to include this book's title and author as well as your name, email address, and phone number. I will carefully review your comments on the book.
Contents
Chapter 1. Introduction to C# . 3
1.1 Introduction . 3
1.2 Evolution of C# . 3
1.3 Characteristics of C# . 3
1.4 Applications of C# . 5
1.5 Difference between C++ and C# . 6
1.6 Difference between Java and C# . 7
Questions and answers . 8
Chapter 2. Understanding .NET strategy . 10
2.1 The .NET Strategy . 10
2.2 The Origins of .NET technology . 10
2.3 The .NET Framework . 12
2.4 The Common Language Runtime . 12
2.5 Managed Code . 14
2.6 Visual Studio.NET . 14
2.7 . NET Languages . 14
2.8 Benefits of .NET approach . 15
2.9 C# and .NET . 15
Questions and Answers . 16
Chapter 3. Data Type, Literals and Variables. 19
3.1 Data Types . 19
3.3 Variables . 23
3.4 Default values of common data types . 24
3.5 Scope of Variables . 24
3.6 Constants . 25
3.7 Boxing . 26
3.8 Parameter Passing . 29
Questions and Answers . 33
Chapter 4 Operators and Expressions . 35
4.1 C# Operators . 35
4.2 Type conversion . 44
Questions and Answers . 46
Chapter 5 Decision Making and Branching . 48
5.1 Decision Making With IF Statement 48
5.2 Nesting of IF… ELSE statement 49
5.4 The SWITCH statement 50
Questions and Answers . 53
Chapter 6 Decision Making and Looping . 55
6.1 Loop Structures . 55
6.2 jumps in loops . 62
Questions & Answers . 64
Chapter 7 Methods in C# . 70
7.1 Declaring a method. 70
7.2 Invoking Methods . 70
7.4 Method Overloading . 71
Questions & Answers . 73
Chapter 8 Arrays . 74
8.1 Creating a one-dimensional array. 74
8.2 Initializing one-dimensional arrays . 74
8.3 Creation of two-dimensional array . 75
8.4 Initializing two-dimensional arrays . 75
8.5 Variable Size Arrays (Jagged Arrays) 75
8.6 Differences between Regular arrays and Jagged arrays . 76
8.7 The System.Array class . 77
8.8 The ArrayList Class . 80
Questions & Answers . 86
Chapter 9 Handling Strings . 91
9.1 Immutable String. 91
9.2 Creating Strings . 91
9.3 String Methods . 91
9.4 MutableString( StringBuilder class )
9.5 Arrays of String . 100
9.6 Regular Expressions . 100
Questions & Answers . 101
Chapter 10 Structures and Enumerations . 103
10.1 Structures . 103
10.2 Defining a Structure . 103
10.3 Creating a structure instance . 104
10.4 Nested Structures . 104
10.5 Enumerations . 105
10.6 Enumerator type conversion . 107
Chapter 11 Classes and Objects . 108
11.1 Basic principles of OOP’s
11.2 Class . 110
11.3 Objects . 110
11.4 Defining a class . 110
11.5 Member Variables or Instance Variables . 110
11.6 Methods . 111
11.7 Creating Objects . 111
11.8 Accessing Class Members . 111
11.9 Constructors . 112
11.10 Constructor Overloading . 112
11.11 Static Members . 113
11.12 Static Constructors . 114
11.13 Private Constructors . 115
11.14 Copy Constructor 116
11.15 Destructors . 116
11.16 The this Reference . 117
11.17 Constant Members . 118
11.18 Read-Only Members . 118
11.19 Properties . 119
11.20 Indexers . 120
Questions and Answers . 122
Chapter 12 Inheritance and Polymorphism .. 124
12.1 Classical Inheritance . 124
12.2 Containment Relation . 125
12.3 Inheritance in C# . 126
12.4 Defining Sub class constructors . 127
12.5 Multilevel Inheritance . 128
12.6 Hierarchical Inheritance . 129
12.7 Constructors and Inheritance . 130
12.8 Method Hiding . 133
12.9 Method Overriding . 134
12.10 Abstract methods . 134
12.11 Abstract classes . 135
12.12 Sealed Classes . 136
12.13 Sealed methods . 137
12.14 Inclusion Polymorphism or Dynamic binding . 138
12.15 Operation Polymorphism or Static binding . 139
Questions & Answers . 140
Chapter 13 Interfaces . 141
13.1 Introduction to Interfaces . 141
13.2 Explicit interface member implementations . 142
Questions and Answers . 144
Chapter 14 Namespaces . 145
14.1 Introduction to Namespace . 145
14.2 Using namespace . 146
Chapter 15 Delegates and Events . 147
15.1 Delegates . 147
15.2 Delegate Declaration . 147
15.3 Delegate methods definition . 147
15.4 Delegate instantiation . 148
15.5 Delegate invocation . 149
Chapter 1. Introduction to C#

1.1 Introduction
C# is a simple, modern, object-oriented, versionable, compatible, flexible, interoperable and type safe programming language originated from C and C++. It combines the prominent features of modern programming languages like C++, Java, Visual Basic, etc. It is used mainly to create .NET applications. The .NET is the most modern development platform of Microsoft that enables the development of component-based applications. The .NET platform supports more than 20 different languages and the list is growing day by day. The C# compiler is considered to be the most efficient compiler in the .NET family and a major part of the .NET base classes libraries itself are written in C#.

1.2 Evolution of C#
In the past two decades C and C++ were the most powerful and widely used languages for developing commercial and business softwares. These languages were often criticized for its longer development time and hence reduced productivity. So the developer community was longing for a highly productive and powerful language for their development needs. They required an environment that supports the emerging web standards and one that provides easy integration with existing applications. To address these problems Microsoft developed a platform called .NET. The alpha version of it was released in the mid of year 2000. Also in the same year Microsoft announced their C# language as a de fact language of the .NET platform. The C# compiler is considered to be the most efficient compiler in the .NET family and a major part of the .NET base classes libraries itself are written in C#.
1.3 Characteristics of C#
The major characteristics of C# are:
· Simple
C# was designed to be easy for the professional programmer to learn and use effectively. If you have some programming experience, you will not find C# hard to master. Also, some of the confusing concepts from C++ are either left out of C# or implemented in a clearer manner. Say for example the complex pointers in C++ are missing in C#. In C++ you have ::, . , -> operators for namespaces, member access and references respectively. But in C# a single dot ( . ) operator does all these operations.
· Modern
The C# is emerged as a language for writing NGWS (Next Generation Windows Services) applications. In C# memory management is automatic and is no longer a responsibility of the programmers. This automatic memory management is a responsibility of C# garbage collector. Another modern feature of C# is that it support cross language exception handling. A new data type called decimal is added in C# for monetary calculations. Another modern feature of C# is that it support a robust security model.
· Object-oriented
C# supports major object oriented programming features such as data encapsulation, inheritance and polymorphism. It contains keywords for declaring new classes and their methods and properties and for implementing encapsulation, inheritance and polymorphism.
· Vers

  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents