C# Introduction OOP - c# - c# tutorial - c# net
What are the OOPs concepts in C# ?
- OOP stands for Object Oriented Programming.
- It is a programming methodology that uses Objects to build a system or a web applications using programming languages such as C#, Vb.net etc.
- OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects.
![OOPs features](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/c-sharp-oops-concept.png)
OOPs Features
- An object is a group of data and methods. The data and the methods are called members of an object.
- The data of the objects can be accessed only by the functions associated with that object.
- The functions of one object can access the functions of another object.
- The main advantages and goals of object oriented programing are to create complex software faster to develop and easier to maintain.
- In C#, OOP enables the easy reuse of code by applying simple and commonly accepted rules.
- There are some basic programming concepts in OOP:
- Abstraction
- Polymorphism
- Encapsulation
- Inheritance
Abstraction:
- Abstraction is the process of hiding the working style of an object, and displaying the information of an object in an easy method.
![learn c# - c# tutorial - c# abstraction - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-abstraction.png)
Polymorphism:
- Polymorphism is the process of using an operator or a function in different ways for different data input. Polymorphism is one of the important concepts of OOP.
Encapsulation
- Encapsulation means hiding the code and data into a single unit to protect the data from the outside world.
Inheritance:
- Inheritance is a process of deriving the new class from already existing class. C# is a complete object oriented programming language. Inheritance is one of the primary concepts of object-oriented programming.
![Multiple Inheritance](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/c-sharp-multiple-inheritance.gif)
Multiple Inheritance
![learn csharp tutorial - c# class object model - c# example programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-class-objects.png)
C# class object model
![learn csharp tutorial - c# class object model advanced - c# example programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-class-objec-model.png)
c# class object model advanced
Type of Association in c# :
- Dependency
- Simple Association
- Bidirectional Association
- Aggregation
- Composition
- Inheritance
- Interface
![learn c# - c# tutorial - c# class association - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/class-association.png)
![learn c# - c# tutorial - c# csharp dependency in classes - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-dependency-in-classes.png)
![learn c# - c# tutorial - c# simple association in csharp - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/simple-association-in-csharp.png)
![learn c# - c# tutorial - c# bidirection association in csharp - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/bidirection-association-in-csharp.png)
![learn c# - c# tutorial - c# csharp aggregation - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-aggregation.png)
![learn c# - c# tutorial - c# composition - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-composition.png)
![learn c# - c# tutorial - c# inheritance - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-inheritance.png)
![learn c# - c# tutorial - c# interfaces - c# examples - c# programs](https://wikitechy.com/tutorials/csharp/img/c-sharp-images/csharp-interfaces.png)