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 null String to Integer, it throws me an exception. But i have to cast the null into Integer.
Share
You cannot cast from String to Integer. However, if you are trying to convert string into integer and if you have to provide an implementation for handling
nullStrings, take a look at this code snippet: