Java Program:

- To print whether an alphabet is Vowel or Consonant

Example:

User Input: z

Output: It's a consonant

import java.util.Scanner;
public class VowelOrConsonant {
  public static void main(String []args) {
    char c;
    Scanner userInput = new Scanner(System.in);
    System.out.print("Enter your character : ");
    c = userInput.next().charAt(0);

    if(c=='a'||c=='A'||c=='e'||c=='E'||c=='i'||c=='I'||c=='o'||c=='O'||c=='u'||c=='U')
      System.out.println("It's a vowel");
    else 
      System.out.println("It's a consonant");
  }
}

Output:

  Enter your character : E
  It's a vowel
Program
basic

You should know first :

Vowel alphabets: a, e, i, o, u

Consonant alphabets: Alphabets other than vowels

//Check for vowels both in uppercase & lowercase
  if(c=='a'||c=='A'||c=='e'||c=='E'||c=='i'||c=='I'||c=='o'||c=='O'||c=='u'||c=='U') {
    //if true print vowel
  }
  else {
    //if false print consonant
  } 
  
Concept

Coming Soon !

Quick
Tutorial

Quote

In order to carry a positive action, we must develop here a positive vision.