In this Program you’ll learn Java Program to check Vowel or Consonant using Switch Case, so Before moving with program lets first understand what exactly is Vowel and Consonant which will help us understand the program.
The Alphabet A,E,I,O and U are Vowels irrespective of their case (Smallcase/UPPERCASE). And the remaining Alphabets are Consonants.
Example: Program to check Vowel or Consonant using Switch Case
Here we will write Java Program to check Vowel or Consonant using Switch Case, here when the user enters the value the program checks all the cases and then till it reaches Case U. In this way we can Identify the character is consonant or Vowel.
Program to check Vowel or Consonant using Switch Case
public class VowelConsonant {
public static void main(String[] args) {
char ch = 'Z';
switch (ch) {
case 'A':
case 'E':
case 'I':
case 'O':
case 'U':
System.out.println(ch + " is Vowel");
break;
default:
System.out.println(ch + " is Consonant");
}
}
}
When you run the program, the output will be:
i is vowel
Output 2:
P is a Consonant

Related Programs
- Java Program to Convert Milliseconds to Minutes and Seconds
- Java Program to Calculate Standard Deviation
- Java Program to Check Armstrong Number
- Java Program to Calculate Average Using Arrays
- Java Program to search a number using linear search
- Java Program to reverse the Array
Ask your questions about Java Program for decimal to hexadecimal conversion in Java and clarify your/others doubts by commenting. Documentation.
Please write to us at [email protected] to report any issue with the above content or for feedback.