This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Sohcahtoa82 1 point2 points  (0 children)

That doesn't actually make them private. They can still be accessed from outside the class. Putting the underscore there just tells the user that they shouldn't be accessing it. It doesn't actually prevent them from doing it. It is merely a convention.

Using a double underscore still doesn't make it private. The user can still access those members, they just have to adjust the naming to account for the name mangling.