Why cannot cast Integer to String in java?
I found some strange exception:

    java.lang.ClassCastException: java.lang.Integer 
     cannot be cast to java.lang.String


How it can be possible? Each object can be casted to String, doesn't it?

The code is:

    String myString = (String) myIntegerObject;

Thanks.



Why cannot cast Integer to String in java?
===

I found some strange exception:

    java.lang.ClassCastException: java.lang.Integer 
     cannot be cast to java.lang.String


How it can be possible? Each object can be casted to String, doesn't it?

The code is:

    String myString = (String) myIntegerObject;

Thanks.


