The counter in the while loop is standing. It does not pass the other words : I try make a word counter. I fragmented using the split method for string but I can not count the words. The loop is stopping. Can you help me for word counter?

Desired: To find out how many times a word in a article repeats.
	

	
	
	public static void main(String[] args) {
	    int count = 0, i=0;
	    int max,a;
	    ArrayList<Integer> lastCount = new ArrayList<Integer>();
		String yazi ="How ı can do that? I don't know. Can you help me? I need help for counter. Thanks in advance for all.";
		String yazi1 = yazi.replace(",","");
		yazi1 = yazi1.replace(".", "");
		yazi1 = yazi1.replace("?", "");
		yazi1 = yazi1.replace("!", "");
		yazi1 = yazi1.toLowerCase();
		yazi1 = yazi1.replace("ı", "i");
		String[] words = yazi1.split(" ");
		for(a=0; a<words.length;a++){
			while(i<words.length){
			if(words[a].equals(words[i])){
				max = 0;
				lastCount.add(a,max+1);
				i++;
			}			
			else
			i++;
			} 
		
		
			System.out.println(a+1 +". Word: " + words[a] + " || Counter: "+lastCount.get(a));
				}
	} 



