code: public static int getOccurenceCount(char c, String s) 
      {
          int ret = 0;
  
          for(int i = 0; i < s.length(); i++)
          {
              if(s.charAt(i) == c)
                  ++ret;
          }
  
          return ret;
      }
docs: Returns the number of occurences of the given character in the given string.
  @param c The character to look for occurrences of
  @param s The string to search
  @return The number of occurences