The true runtime type of an object is set when it's instantiated with "new."
In the above example, the object referenced by b has a true runtime type of Bbase, and the object referenced by b1 has a true runtime type of Dderived. Neither of these are instances of Ddderived, which is why the casts fail.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
You had your fun. Now it's time to go to jail. Thanks for your help tiny ad.