Hi Marco,
Java's private access modifier means only private for a class, as you correctly pointed out.
lol, I just quoted the answer.
ahh that's what it was referring to.
Still, I think this sentence is confusing:
So two objects of the same class could access each other's private data.
I kept thinking:
Well lets say I have another class X which has a method:
public int timesWrecked(Car c) {
c.getSomething(); //where something is private
}
Now if I have an instance of X, and I do x.timesWrecked(c); there you go, I just accessed private data from an object which is not of the same class... use a getter... whatever.
Anyway, yes the equals() one made sense. You wouldn't be able to do otherCar.gear in a class other than Car.
Thanks, that cleared things up (wasn't sure what the question was referring to)
Regards,
Justin