+ 1
What is encapsulation in c#?
With example
2 odpowiedzi
+ 2
Think of it as a capsule with some stuff in it, each capsule is unique and sometimes one is not allowed to see what the other one has inside
+ 2
Now imagine a wall full of pictures or information that each of them can access one another, that's something you would not call encapsulation
Sorry if I'm being figurative, but it helps me understand it better that way 😉
Check out this article for a literal explanation:
https://www.techopedia.com/definition/3787/encapsulation-c#:~:text=Encapsulation%2C%20in%20the%20context%20of%20C%23%2C%20refers%20to,a%20class%20to%20the%20code%20outside%20the%20class