I found some strange exception:
java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
How it can be possible
Objects can be converted to a string using the toString() method:
toString()
String myString = myIntegerObject.toString();
There is no such rule about casting. For casting to work, the object must actually be of the type you're casting to.