access specifiers?

in classes there are three different acces specifiers rigt? (i asume there arent more?)
and i have been told that declaring a variable inside of a public access specifier is bad programming, and that those are supposed to be placed inside of the private one. why is that? and also is there any way at all to acces stuff inside of private, from another function?
because it is your program, and users do not need to know how your function run. all what a user needs to know is your function name to call it.

and yes, there is a way to access stuff inside private.

getter and setters
Last edited on
getters and setters?

taking a wild guess here but is that related to pionters and stuff?
Topic archived. No new replies allowed.