Back to Browse

Abstraction & Encapsulation | (C# OOPS) (Today 2018)

24.3K views
Jun 21, 2018
21:31

Abstraction and Encapsulation in C# and provides the real time example of Abstraction and Encapsulation in C#. I hope this will very helpful for your future real-time project development. and Given the real-time example of abstraction and encapsulation. Explain Abstraction and Encapsulation with real-time the example. What is Data Abstraction?: it is used to provide the relevant information and hide the irrelevant information from the user it is called as data abstraction. It will only expose the necessary information to outside world. It will provide the necessary information to the user and hide unnecessary information from the user. Example: Console.WriteLine(); This is the example of abstraction. The "Console.WriteLine()" method is provided by Microsoft and they have written a lot of code behind the "WriteLine()" method but, they don't show all the code to the user. They only provide the what the user want means they provide only necessary information to the user. and hide the unnecessary information from the user. The user doesn't need what code written behind the "WriteLine" method. so that, they expose the "WriteLine()" method to outside world. User can access easily. This is the concept of data abstraction. What is need of Data Abstraction? if you don't want to expose your logic to outside world. And also If you want to hide your business logic from outside world. To achieve this implementation the oops concept came i.e. Data Abstraction. Non-Technical Example: TV remote is the also example fo abstraction.TV remote is assembled from the collection of circuits but they don't show all circuits behind the remote and provide remote to user use it. When the user presses the key on remote the channel gets changed. This concept is called as providing the relevant information to the user also called as data abstraction. What is need of Data Encapsulation? If you want to hide the complexity and provide the security to data. To achieve this implementation the oops concept came i.e. Data Encapsulation. What is Data Encapsulation? It is used to bind or group the related data together, and hide the complexity, and provide the security for the data. It is called Data Encapsulation. Example: Class Non Technical Example: TV Remote, Car Remote etc. More Detail: https://www.programmingwithshri.com/ Video Links: https://www.youtube.com/watch?v=Cow5nWIOx8I https://www.youtube.com/watch?v=yu63SSNY5sQ&t=324s https://www.youtube.com/watch?v=PqSc9xWtyRQ&t=633s

Download

0 formats

No download links available.

Abstraction & Encapsulation | (C# OOPS) (Today 2018) | NatokHD