This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Object "a" is an instance of class Alpha. Therefore, no instance of class Beta is able to access a private member of class Alpha. If you want to access a private member of class Alpha, then you will have to do it from an instance of class Alpha.
Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Originally posted by Deon Smith: The question I have of the code below is, why is Alpha a not of type Alpha but of type Beta?
That is not the case. ais of type Alpha. Why did you believe that a were of type Beta? I'd recommend that you carefully reread the lesson from Sun's Java Tutorial where you got this example (Controlling Access to Members of a Class). [ July 21, 2002: Message edited by: Dirk Schreckmann ]