Book Image

Learn C# in 7 days

By : Gaurav Aroraa
1 (1)
Book Image

Learn C# in 7 days

1 (1)
By: Gaurav Aroraa

Overview of this book

This book takes a unique approach to teach C# to absolute beginners. You’ll learn the basics of the language in seven days. It takes a practical approach to explain the important concepts that build the foundation of the C# programming language. The book begins by teaching you the basic fundamentals using real-world practical examples and gets you acquainted with C# programming. We cover some important features and nuances of the language in a hands-on way, helping you grasp the concepts in a fluid manner. Later, you’ll explore the concepts of Object-Oriented Programming (OOP) through a real-world example. Then we dive into advanced-level concepts such as generics and collections, and you’ll get acquainted with objects and LINQ. Towards the end, you’ll build an application that covers all the concepts explained in the book. By the end of this book, you will have next-level skills and a good knowledge of the fundamentals of C#.
Table of Contents (15 chapters)
Title Page
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Abstraction


Abstraction is the process where relevant data is shown by hiding irrelevant or unnecessary information. For example, if you purchase a mobile phone, you'd not be interested in the process of how your message is delivered or how your call connects another number, but you'd be interested to know that whenever you press the call button on your phone, it should connect your call. In this example, we hide those features that do not interest the user and provide those features that interest the user. This process is called abstraction.

Implementing abstraction

In C#, abstraction can be implemented with the use of:

Abstract class

Abstract class is half-defined that means it provides a way to override members to its child classes. We should use base classes in the project where we need have a need same member to all its child classes with own implementations or want to override. For an example if we have an abstract class Car with an abstract method color and have child classes HondCar...