public static int countWords(String s)
	{
		/*
		 * Please implement this method to return the word count in a given String. 
		 * Assume that the parameter String can only contain spaces and alphanumeric characters.
		 */
		
		if(s ==null ||s.isEmpty()){
			return 0;
		}
		int count =0;
		int length = s.length();
		boolean hasChar = false;//if have characters before space
		for (int i = 0; i < length; i++) {
			char c = s.charAt(i);
			if(Character.isWhitespace(c)){
				if(hasChar){
					count++;
					hasChar = false;
				}
			}else{
				hasChar = true;
			}
		}
		return count;
	}