applying encapsulation to a project? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 3

applying encapsulation to a project?

i am learning c++ and its been nearly a week since i learned encapsulation. i stopped progressing in the main course cause i want to see why it is used.i understand its a method to secure data and perhaps making the code more flexible and thats why i see it as an important subject.i tried youtube and google but i am not still satisfied. anyone with a project idea or perhaps an interesting and related experience want to share?or perhaps checking my codes on my profile and see if i can secure some data with this method. thanks guys and good day!

1st Nov 2018, 9:04 AM
sina
sina - avatar
1 Respuesta
+ 8
I think that you must to create private variables with method set and get if you need it. Sometimes a variable need just a get method. Sometimes a attribute have a method get and set. // Sorry my english
22nd Dec 2018, 3:22 AM
Pedro H.J
Pedro H.J - avatar