Assign properties value | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Assign properties value

Why we should use changeName method to change the name if we can assign it directly? Is p.changeName("John") same as p.name = "John" ?

18th Dec 2016, 6:39 AM
Fanny Hasbi
Fanny Hasbi - avatar
1 Answer
0
Encapsulation
18th Dec 2016, 7:46 AM
Rishi Anand
Rishi Anand - avatar