title: How do I find the number of consonants,and vowels separately in a given sentence
body: <p>How can I add on to the existing program below? I need to be able to find the number of consonants,words,spaces,and special characters. I already have the vowels?</p>
  
  <pre><code>import java.lang.String;
  import java.io.*;
  import java.util.*;
  
  public class CountVowels
  {
      public static void main(String args[])throws IOException
      {
          BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
          System.out.println("Enter the String:");
          String text = bf.readLine();
          int count = 0;
          for (int i = 0; i &lt; text.length(); i++) {
              char c = text.charAt(i);
              if (c=='a' || c=='e' || c=='i' || c=='o' || c=='u') {
                  count++;
              }
          }
          System.out.println("The number of vowels in the given sentence are " + count);
      }
  }
  </code></pre>