Answers for "how to deal with java.lang.classcastexception"

3

classcastexception in java

Object someStringAsObject="Hello";
String asString=(String)someStringAsObject;//works
Integer asInteger=(Integer)someStringAsObject;//throws ClassCastException because it is a String and not an Integer
Posted by: Guest on April-04-2021

Code answers related to "how to deal with java.lang.classcastexception"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language