Paul Anilprem wrote:>So objects just have access to private members of other objects of the same type..?
No, they don't just have access to private members. They have access to public, protectec, and default members also.
That's not quite what I meant by the 'just' but fair enough, haha.
Paul Anilprem wrote:>
>That seems like it has potential for issues.
You could say that but I don't think it really is an issue because it is still the developer/owner of the class who decides what members should be accessed and/or modified in any of its methods. It is not like someone else is able to modify fields of object of some one else's class.
Sure, I do see you're point, it's just that mistakes can be made over time and things exposed which shouldn't be.
It's just kind of surprising that it is this way, it had me wondering if I was missing something, hence the question.
Paul Anilprem wrote:>
In any case, that is just how Java does it.
So it is