Python Programming - Encapsulation - Discussion

Discussion Forum : Encapsulation - General Questions (Q.No. 33)
33.
Which of the following is a common guideline when using encapsulation?
Avoid using private variables altogether.
Make all variables public for ease of access.
Provide getter and setter methods for private variables as needed.
Use global variables extensively.
Answer: Option
Explanation:
A common guideline when using encapsulation is to provide getter and setter methods for private variables as needed to control access.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.