I am using the Sybex SCJP book to study for the 1.5 exam. Last night I did one of their mock exams on the CD and got a question wrong because, so the answer said, you "cannot access protected superclass data of a different instance".
The specific context was a class a.X extends b.Y, and b.Y has a protected instance variable called 'size'. The question asked if you could use the expression new X().size within X's class definition. Note that 'size' was not itself redeclared within the class definition so it was available to X only through inheritance. I said yes, but the answer said no.
I have since checked this within Eclipse and it seems that you CAN use the expression. Can anyone confirm exactly what the rule is here? Probably more importantly, I guess the Sybex book was trying to make a point here and although they have made it inaccurately can anyone suggest exactly what point they might have been trying to make?
Any assistance appreciated!