Java Program to Check if Input is a Vowel

This fun Java Program will check the users input and output whether it is a Vowel or Consonant

import java.util.Scanner;

class Vowel {
public static void main(String[ ] arg) {

boolean isVowel=false;   
Scanner scanner=new Scanner(;

System.out.println("Enter a character : ");
char;    scanner.close();   
switch(ch)     {   

case 'a' :   
case 'e' :   
case 'i' :   
case 'o' :   
case 'u' :   
case 'A' :   
case 'E' :   
case 'I' :   
case 'O' :   
case 'U' :

isVowel = true;     }   
if(isVowel == true) {   

System.out.println(ch+" is a Vowel");  }

else {   

System.out.println(ch+" is a Consonant");      else       
System.out.println("Input is not an alphabet");         } } }

Click here to run this code

More Free Code Examples;

Hello World in 10 Programming Languages

Java Odd or Even

Java Current Time and Date Program


Popular posts from this blog

Multi-tap Keypad Text Entry

HTML5 Crossword 1