Casting Object to Date
807603Nov 15 2007 — edited Nov 15 2007I have a
HashMap
I call the get(key) method and this method returns me the Object type.
A field which is Date type whose key is DATE_KEY and when i call get(DATE_KEY) it returns me the Object type but I need to convert it to Date and when i cast it, I get classcast exception. Any clue/solution pls?
Line 1. xxx = xxx.get(DATE_KEY);
xxx.get(DATE_KEY).getClass(),getName() says it is a Date type but when I cast it to date in line 1, it throws classcast exception.