It is easy if you try to understand. Conversion of instance of Subclass -> Base allowed without any cast. but
Base -> Subclass not allowed without cast. (It is same like that for primitives). Even when you cast from Base -> Subclass the subclass should actually contain the methods to be invoked using the subclass reference variable. Search for examples you will find plenty of them, Good luck.
"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
Hi well when u r assigning a subclass type to a superclass type u don't have to cast explicitly. ex : String s="hello"; Object o =s; but when u r assigning a superclass type to a subclass type u have to explicitly cast it to a subclass type.Ex Object o = new Object(); String s=(String) o; But remember that in both cases the classes involved should be from the same inheritence tree. i.e. the classes must be related by inheritence. otherwise u will get ClassCastException
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com