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.
What should be kept in mind regarding the comple and run without error for the following classes and references: class One extends Object implements Runnable class Two extends One implements Observer Given the references: One aone = new One(); Two atwo = new Two(); can someone explain which will give compile and run time error and why? 1. Object obj = aone; Runnable rn = obj; 2. Object obj = aone; Runnable rn = (Runnable)obj; 3. Object obj = aone; Observer ob = (Observer)aone; 4. Object obj = atwo; Observer ob2 = obj;