What is Abstraction in C#?

The process of defining a class by providing the necessary and essential details of an object to the outside world and hiding the unnecessary things is called abstraction in C#. In C# we can hide the member of a class by using private access modifiers.
Let us understand this with a car example. As we know a car is made of many things, such as the name of the car, the color of the car, gear, breaks, steering, silencer, diesel engine, the battery of the car, engine of the car, etc. Now you want to ride a car. So to ride a car you should know function of Gear,Break and Steering you no need to know engine of the car.so here in case of abstraction we can hide engine details so to do that make engine function private inside class and all require thing what we should know make it's function public.

Comments

Popular posts from this blog

Pagination of DataGrid in WPF using MVVM

Connect SQL Server Database to WPF Application and Perform CRUD Operations

Filter DataGrid and ListView in wpf using ICollectionView