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

Encapsulation


Encapsulation is a process where data is not directly accessible to user. When you want to restrict or hide the direct access to data from client or user, that activity or a process is known as encapsulation.

When we say information hiding that means hiding an information that doesn't require for user or user is not interested in the information for example - when you buy a bike you'd not be interested to know how it's engine works, how fuel supply exists internally, but you're interested about the mileage of bike and so on.

Note

Information hiding is not a data hiding but it is an implementation hiding in C# for more information refer: http://blog.ploeh.dk/2012/11/27/Encapsulationofproperties/.

In C# when functions and data combined in a single unit (called class) and you cannot access the data directly is called encapsulation. In C# class, access modifiers are applied to members, properties to avoid the direct access of data to other cases or users.

In this section, we will discuss...