Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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
Comment

PREVIOUS NEXT
Code Example
Java :: how to convert primitive int to Integer in java 
Java :: how to use sql file in java 
Java :: Using enum values as string literals 
Java :: dequeue in java 
Java :: Concept of Association in java 
Java :: radio button android:inputType 
Java :: Java push() Method 
Java :: how to find length of array in java 
Java :: java get number of months between two dates 
Java :: start async task android 
Java :: loop hash map 
Java :: programmatically click button javafx 
Java :: how to set boolean to false if null java 
Java :: hide icon android studio 
Java :: add two numbers bitwise 
Java :: Binary tree using linked list in Java 
Java :: java class jar determine 
Java :: how to get color from a hex string in android studio 
Java :: install java using cmd 
Java :: multiplication table using while loop in java 
Java :: set view size android 
Java :: read stream java 
Java :: java time 
Java :: java search string in string 
Java :: tostring in java 
Java :: array to string java 
Java :: Area of a Circle in Java Programming 
Java :: print in java 
Java :: retrofit 
Java :: list java 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =