What is encapsulation?
What is encapsulation?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kaushik DudhatPosted Jul 9, 2019, 7:21 AM
Amit MohantyPosted Jul 10, 2019, 12:04 AM
Consider a real life example of encapsulation, in a company there are different sections like the accounts section, finance section, sales section etc. The finance section handles all the financial transactions and keep records of all the data related to finance. Similarly the sales section handles all the sales related activities and keep records of all the sales. Now there may arise a situation when for some reason an official from finance section needs all the data about sales in a particular month. In this case, he is not allowed to directly access the data of sales section. He will first have to contact some other officer in the sales section and then request him to give the particular data. This is what encapsulation is. Here the data of sales section and the employees that can manipulate them are wrapped under a single name “sales section”.
For more details refers to below links.
https://www.c-sharpcorner.com/article/encapsulation-in-C-Sharp/
https://www.tutlane.com/tutorial/csharp/csharp-encapsulation
https://www.tutorialspoint.com/csharp/csharp_encapsulation.htm
Sonu GuptaPosted Jul 9, 2019, 11:22 PM
Jaish MathewsPosted Jul 9, 2019, 10:13 AM