1To find whether a given string contains a number,
2convert it to a character array and find whether
3each character in the array is a digit using the isDigit()
4method of the Character class
1//Add this to your code and call
2static private boolean isMyNumber(String s){
3 try{
4 Integer.parseInt(s);
5 return true;
6 }catch (Exception e){
7 return false;
8 }
9 }