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.
Hello, Could some one please explain to me the following rules of object reference conversion: - If Old Type is an interface and New Type is a class, then the New Type must be Object. - If Old Type is an array and New Type is a class, then New Type must be Object. Thank you very much. Brian
The new object reference must be a supertype of the old object reference. No class can be considered a supertype of an interface except for Object. (If we have interface/classes A and B, and B is a subclass or subinterface of A either directly or though some intervening "layers" of classes/interfaces, then A is a supertype of B.) Object arrays, and arrays of primitives are considered of type Object. [ June 27, 2002: Message edited by: Anthony Villanueva ]