title: count vowels in a string in java
body: <p>I want to count the vowels in each word in a string and print the number of vowels for each word. I just know how to count all the vowels in a string and I tried that. But I want the count of vowels for each word. How can I print that?</p>
  
  <pre><code>String s="hai hello";
      int count=0;
      for(int i=0;i&lt;s.length();i++)
      {
          if(s.charAt(i)=='a'||s.charAt(i)=='e'||s.charAt(i)=='i'||s.charAt(i)=='o'||s.charAt(i)=='u')
              count++;
      }
      System.out.println(count);
  </code></pre>
  
  <p>If the <strong>input</strong> is "hai hello" then the <strong>Expected output</strong> will be "1 2".</p>