Introduction
In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..
import java.util.Scanner; class Char { public static void main(String[ ] arg) { int i=0; Scanner sc=new Scanner(System.in); System.out.println("Enter a character : "); char ch=sc.next( ).charAt(0); if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') { System.out.println("Entered character "+ch+" is Vowel"); } else if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')) System.out.println("Entered character "+ch+" is Consonant"); else System.out.println("Not an alphabet"); } }