Problem Statement Write a Java program to count both vowels and consonants in a given string Conditions Only alphabets should be considered for counting Input Hello World! Output Vowels count - 3 Consonants count - 7 Explanation The vowels in the given string are e,o and o and so the vowels count is 3. Likewise, the consonants in the given string are h,l,l,w,r,l and d and so the count is 7.