This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Casting does not magically convert any kind of object into any kind of other object. A cast is only an indicator for the compiler that says "look, I have some object here, and I know that it's really a java.util.Date, so treat this thing as a java.util.Date". If, at runtime, the object really is not a java.util.Date, you will get a ClassCastException.
If you want to know what the object's real type is, try adding a line like this to your application:
The point is that you don't cast objects, you cast object references. Java does not even allow variables that are objects.
Casting is for when you know that an object reference actually points to an object whose type is a subclass of the declared type of the object reference. So, if you have an object reference declared to be an Object, but you know that it actually points to an object that is a Date, you can cast the reference to a Date. This has NO effect on the object itself.
If you try to cast an object reference to a class that is not compatible with the object to which it points, you get a ClassCastException. So, if your object reference declared as Object really does point to a plain Object, but you try to cast to Date, you get ClassCastException.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.