Programmatically change a variable from public to private

Is it possible for me to programmatically change a variable from public to private in a class function call?

+1
source share
2 answers

No, it is not possible to change a variable from public to private.

0
source

Use access modifiers (setters, getters) and set the private property to the public property.

You cannot change the visibility of a property.

0
source

Source: https://habr.com/ru/post/1437688/


All Articles