exception « float « Java Data Type Q&A

1. Strange Java cast exception. Why can't I cast Long to a Float?    stackoverflow.com

java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Float Why is this a problem? The numbers that I'm trying to cast are decimals in the domain [-10.0, 10.0]. They start out as Object instances ...

2. Help! Exception when trying to use Float    forums.oracle.com