This is supposed to counter the number of a certain character but it keeps returning zero. This is my call in the main System.out.println("Frequency of 'e' = " + charFrequency(stringArray, 'e'));
public static int charFrequency(String[] s, char ch){
int counter=0;
for(int i=0; i<s.length; i++){
if(s.equals(ch)){
counter++;
}
else{
return 0;
}
}
return counter;