Originally posted by Uttara Rishi:
Hi Ranchers,
In the Java rules round up game it said that one object can access the private variable of another. But I got an error for the following code.
Can somebody please explain?
Thanks in advance.
Uttara Rishi.
There is nothing to explain. An object of one class type can't access the provide variables of another object of a different class type. Perhaps the "round up" game asked about accessing the variable of another object of the same class type, which is allowed.
Henry