Casting is for magicians, not programmers.
In
Java, casting doesn't actually change objects, ever, or create new ones*.
It just provides you with a different view of the same object. E.g., if I do:
Object o=(Object)"hello"; then I've got an Object view of that string. I now can't ask it how long it is, etc., because Objects don't have length.
String s=(String)o; now I've got a String view of it as well. No new object.
By the way, as all Strings are Objects, you don't need the cast to Object in the first code snippet of this post.
* autoboxing alters that slightly, but not enough to be worth explaining in a beginner forum.