Acces Level

public class Xxxx {private int x = 0;private int y = 1;public void add(Xxxx y1){y1.x++;//Why can i call this attributes directly?where is the hide information...y1.y++;}}Who can explain me that
[270 byte] By [vicpan_7] at [2007-9-30 8:34:29]
# 1

"private" access is meant on the class and not on the object level. That is, a method (running against an instance of the type) can access the private fields of any object of the given type, not only the fileds of the given object instance.

This is true for Java and C++ as well.

BIJ001 at 2007-7-2 19:26:09 > top of Java-index,Administration Tools,Sun Connection...