Is there any way to cast a null to Integer. The null is actually a String, which i am passing in my service layer that accepts it as an Integer. So, whenever i try to cast a
If you are sure you only have to handle nulls,
int i=0; i=(str==null?i:Integer.parseInt(str)); System.out.println(i);
for non integer strings it will throw Numberformat exception