0
What the error in this program to count number of words
public class Program { public static void main(String[] args) { String s; int count=0; s="java is the best"; for(int i=0;i<s.length()-1;i++) { if((s.charAt(i)) = " ") count =count+1; } System .out.println (count); } }
2 Réponses