public class WhileDemo {
 
  /**
   * Count the number of times character c appears
   * in the String s.
   */ 
  public static void countChars(String s, char c) {
    int numChars = 0;
    int index = 0;
    
    while(index != s.length()) {
      if(s.charAt(index) == c) {
        numChars++;
      }
      index++;
    }
    
  }
  
}
