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.
In the below program,I have some doubts on polymorphism concept i.e; while call by Reference
Here I am creating one super class as A and subclass as B.I am using one more class as "HelloAll" for accessing these two class A and B.
First i am creating the Class 'A' object and than creating one reference type as 'B'. And then assigning the object of A class to reference type of subclass as B.
Here depend on the polymorphism concept it must be access the object of 'A' class by using the 'B' class reference type.But it is giving the Run time error.