I have tried to convert my String to an int but my code keeps crashing.
The code is as follows:
String age = getAge();
CalculateDaysSinceBirth((int) age);
But I get a NumberFormatException.
I have tried to convert my String to an int but my code keeps crashing.
The code is as follows:
String age = getAge();
CalculateDaysSinceBirth((int) age);
But I get a NumberFormatException.
 
    
     
    
    Try using Integer.valueOf(age) insted of (int) age
