I cannot understand the code below. but i keep trying
// Is the passed string a number? public static boolean isNumber(String s) { if (s.length() == 0) { return false; } char[] chars = s.toCharArray(); for (int i = 0; i < chars.length; i++) { char c = chars[i]; if (i != 0 && c == '-') { // the string contains a hyphen return false; } if (!Character.isDigit(c) && c != '-') { // not a number and doesn't start with a hyphen return false; } if (i == 0 && c == '-' && chars.length == 1) { // not a hyphen return false; } } return true; } Or Plis give me a string or number that satisfy each of the last 3 if statements. Besides i believe the second last if statement will never be satisfied because c cannot have two values at the same time. Am i correct please help.