This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Well, Jeudy has already explained it. Class casting never creates objects on heap it's the new keyword which is responsible for that. You could check that by executing the following code.
When Line 1 is executed the constructor of the Child class executes and displays the output child object however the same is not true for Line 2 which means the casting has not created another object on heap. Hope it helps.
When you cast something, what it means is that you say to the compiler: "Compiler, I have a variable of type A here, but I want you to treat it as if it is of type B. (Because I know that the variable really refers to an object of type B)."
Casting does not create any objects or do any smart conversions.