From Java Language Specification, (�5.5 Casting Conversion): A value of a primitive type cannot be cast to a reference type by casting conversion, nor can a value of a reference type be cast to a primitive type. What is it that you are trying to accomplish?
Ramu: If you want to convert a primitive type into an object, you would normally use one of the type wrappers built into java.lang. These include Integer Double Float Byte Short Long Char Here is an example.
For my latest books on Java, including Introducing JavaFX 8 Programming, see HerbSchildt.com
Note that the coming Java 1.5 compilers will have a feature known as auto-boxing and auto-unboxing. Primitives won't be cast to objects, but in certain circumstances, the compiler will wrap a primitive up using the appropriate wrapper class, and unwrap wrapper class instances into the appropriate primitive values.