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

Modifiers


Modifiers are nothing but special keywords in C# that are used to declare how a specific method, property, or variable could be accessible. In this section, we will discuss modifiers and discuss their usage with the use of code examples.

Note

The whole point of modifiers is encapsulation. It's about how objects get simplified by encapsulations, and modifiers are like knobs saying how much you want to show to some clients, and how much not to. To understand encapsulation, refer to day seven, Encapsulation.

Access modifiers and accessibility levels

Access modifiers tell us how and where a member, declared type, and so on can be accessed or available. The following discussion will give you a broader idea of all access modifiers and accessibility levels.

public

A public modifier helps us define the scope of the member without any restrictions. This means if we define any class, method, property, or variable with a public access modifier, the member can be accessed without any restrictions...