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.
If you see the snippet of code above, it will give un-convertible types. Look at this snippet
The error must be first coming when you will be assigning c to to ref variable. You can't do that, because C extends B and
in turn B doesn't extends A, so they are inconvertible types. So you cannot assign c to A.
Well, what do you mean by it runs fine and doesn't give any error. Are you talking about this statement
Even at this line, it's going to give you an error of in convertible types.