11

PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑
Page 2: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑
Page 3: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

PROGRAMMING IN C#

Page 4: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑
Page 5: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

V. CHRISTY

(An Imprint of Laxmi Publications Pvt. Ltd.)

BANGALORE ∑ CHENNAI ∑ COCHIN ∑ GUWAHATI ∑ HYDERABAD

JALANDHAR ∑ KOLKATA ∑ ∑LUCKNOW ∑

MUMBAI ∑ RANCHI NEW DELHI INDIA USA GHANA KENYA

Page 6: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

PROGRAMMING IN C#

Copyright © by Laxmi Publicati ons (P) Ltd. All rights reserved including those of translati on into other languages. In accordance with the Copyright (Amendment) Act, 2012, no part of this publicati on may be reproduced, stored in a retrieval system, or transmitt ed in any form or by any means, electronic, mechanical, photocopying, recording or otherwise. Any such act or scanning, uploading, and or electronic sharing of any part of this book without the permission of the publisher consti tutes unlawful piracy and theft of the copyright holder’s intellectual property. If you would like to use material from the book (other than for review purposes), prior writt en permission must be obtained from the publishers.

Printed and bound in India Typeset at Kalyani Computer Services

First Editi on: 2015UPC-9643-225-PROGRAMMING IN C#-CHR

ISBN 978-93-83828-26-5

Price: ` 225.00

Limits of Liability/Disclaimer of Warranty: The publisher and the author make no representati on or warranti es with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranti es. The advice, strategies, and acti viti es contained herein may not be suitable for every situati on. In performing acti viti es adult supervision must be sought. Likewise, common sense and care are essenti al to the conduct of any and all acti viti es, whether described in this book or otherwise. Neither the publisher nor the author shall be liable or assumes any responsibility for any injuries or damages arising herefrom. The fact that an organizati on or Website if referred to in this work as a citati on and/or a potenti al source of further informati on does not mean that the author or the publisher endorses the informati on the organizati on or Website may provide or recommendati ons it may make. Further, readers must be aware that the Internet Websites listed in this work may have changed or disappeared between when this work was writt en and when it is read.

All trademarks, logos or any other mark such as Vibgyor, USP, Amanda, Golden Bells, Firewall Media, Mercury, Trinity, Laxmi appearing in this work are trademarks and intellectual property owned by or licensed to Laxmi Publicati ons, its subsidiaries or affiliates. Notwithstanding this disclaimer, all other names and marks menti oned in this work are the trade names, trademarks or service marks of their respecti ve owners.

PUBLISHED IN INDIA BY

UNIVERSITY SCIENCE PRESS(An Imprint of Laxmi Publications Pvt.Ltd.)

113, GOLDEN HOUSE, DARYAGANJ, NEW DELHI - 110002, INDIA Telephone : 91-11-4353 2500, 4353 2501 Fax : 91-11-2325 2572, 4353 2528www.laxmipublicati ons.com info@laxmipublicati ons.com

& Bangalore 080-26 75 69 30

& Chennai 044-24 34 47 26, 24 35 95 07

& Cochin 0484-237 70 04, 405 13 03

& Guwahati 0361-254 36 69, 251 38 81

& Hyderabad 040-27 55 53 83, 27 55 53 93

& Jalandhar 0181-222 12 72

& Kolkata 033-22 27 43 84

& Lucknow 0522-220 99 16

& Mumbai 022-24 91 54 15, 24 92 78 69

& Ranchi 0651-220 44 64

Bran

ches

C— Printed at:

Page 7: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

Dedicated to the

Lord Jesus Christ

(v)

Page 8: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑
Page 9: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

CONTENTS

Pages

1. .NET FRAMEWORK OVERVIEW .... 3–7

1.1 .NET Framework .... 3

1.2 .NET Framework Architecture .... 4

1.3 Namespaces .... 7

2. INTRODUCTION TO C# PROGRAMMING .... 8–29

2.1 C# Language .... 8

2.2. Getting Started .... 8

2.3. Data Types in C# .... 12

2.4. Variables and Constants .... 16

2.5. Operators .... 18

2.6. Input Output Statements .... 27

3. CONTROL STRUCTURES AND LOOPING STATEMENTS .... 30–48

3.1 Control Structures .... 30

3.2. Looping Statements .... 38

4. ARRAYS AND FORMATS .... 49–67

4.1 Arrays .... 49

4.2. Number Format .... 65

5. CLASS AND OBJECT .... 68–86

5.1. Class and Object .... 68

5.2. Constructor .... 74

5.3. Constructor Overloading .... 81

(vii)

Page 10: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

5.4. Destructor .... 83

5.5. This Operator .... 85

6. FUNCTION AND USES OF STATIC .... 87–102

6.1. Function .... 87

6.2. Uses of Static .... 94

6.3. Boxing and Unboxing .... 101

7. PROPERTIES AND INDEXERS .... 103–114

7.1. Properties .... 103

7.2. Indexers .... 112

8. INHERITANCE AND INTERFACE .... 115–126

8.1. Inheritance .... 115

8.2. Interface .... 121

9. EXCEPTION HANDLING .... 127–139

9.1. Exception .... 127

9.2. User Defined Exception .... 136

10. DATE, MATH AND STRING CLASS .... 140–156

10.1. Datetime Class .... 140

10.2. Math Class .... 148

10.3. String Class .... 152

11. DELEGATES AND EVENTS .... 157–168

11.1 Delegates .... 157

11.2. Multicast Delegate .... 162

11.3. Events .... 164

12. COLLECTIONS I—ARRAYLIST, STACK, QUEUE .... 169–182

12.1. Collections .... 169

12.2. ArrayList .... 170

12.3. Stack .... 174

12.4. Queue .... 178

(viii)

Page 11: PROGRAMMING IN C# · 2018-10-01 · v. christy (an imprint of laxmi publications pvt. ltd.) bangalore ∑ chennai ∑ cochin ∑ guwahati ∑ hyderabad jalandhar ∑ kolkata ∑ lucknow∑

Programming in C#

Publisher : Laxmi Publications ISBN : 9789383828265 Author : V Christy

Type the URL : http://www.kopykitab.com/product/4781

Get this eBook

40%OFF