code: public static boolean isInteger(String s) {
          if (isEmpty(s)) return defaultEmptyOK;
  
          // Search through string's characters one by one
          // until we find a non-numeric character.
          // When we do, return false; if we don't, return true.
          for (int i = 0; i < s.length(); i++) {
              // Check that current character is number.
              char c = s.charAt(i);
  
              if (!isDigit(c)) return false;
          }
  
          // All characters are numbers.
          return true;
      }
docs: Returns true if all characters in string s are numbers.
  
  Accepts non-signed integers only. Does not accept floating
  point, exponential notation, etc.