+ 2
Which example you not understood? And what is you understood already ? Clearly add details here, that simplifies , easiest the solution both ways...
4th Dec 2022, 12:35 PM
Jayakrishna 🇼🇳
0
From my understanding, Some points of encapsulation are: 1. Simplicity 2. Security & secrecy Patients only have to know how to shallow a capsule and it will work. He doesn't have to know what is inside or why it works. Nor should they know. The pharmacy won't want everyone to know their secrets. Example forb security is that you may want to avoid letting people know how passwords are dealt with. Constructors are functions that is called to initialize objects of their classes. Eg: `Person p("John", 20);` might call a constructor of Person class to initialize p with John as p.name and 20 as p.age.
4th Dec 2022, 1:41 PM
Lochard
Lochard - avatar