I am facing a strange behavior in type casting in superclass and subclass.
When type casting in spring's
Listing l1=(Listing)det.getBean("list1"); // legal
Object o=new Object();
circle c=(circle)o; //ClassCastException
list1 bean in the first snippet is actually a
Listing object, and you are just casting to store it in a
In the second snippet,
o is a
java.lang.Ojbect. It is not a
circle instance, so the cast fails in runtime.