In the following question, we are supposed to ask the user for character input and check if the input is a vowel or not using Switch Case construct.


  1. Enter and Store User Input.
  2. Duplicate the input and store it.
  3. Change the Case of the duplicate for lesser comparison and uniformity.
  4. Pass the input through Switch-Case construct.
  5. Check for Vowel.
  6. Print the Result accordingly.
/* Program to check if entered character is vowel or not using Switch Case*/
import java.util.*;
class SwitchVowel
public static void main()
Scanner inp=new Scanner(;
System.out.print("\n Enter Character: ");
char c=((inp.nextLine()).charAt(0));
char z=Character.toUpperCase(c); //Changing Value to UpperCase for uniformity.

switch(z) //Checking Vowel Character using Switch Case
case 'A':
case 'E':
case 'I':
case 'O':
case 'U': System.out.println(c+" is a Vowel.");

default: System.out.println(c+" is a Non-Vowel Character.");



Enter Character: X
X is a Non-Vowel Character.

 Enter Character: u
u is a Vowel.

 Enter Character: 5
5 is a Non-Vowel Character.

Report Error/ Suggestion

Related Posts:

CopyRight © 2020

CopyRight © 2020