MCQs > IT & Programming > PHP > Why is it not recommended to make all of a class's variables public?

PHP MCQs

Why is it not recommended to make all of a class's variables public?

Answer

Correct Answer: You will have no control over which values the attribute can take. Any external code will be able to change it without any constraint.

Explanation:

Note: This Question is unanswered, help us to find answer for this one

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

PHP Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it