In this article, we are going to check given character is vowel or not using Java.
Java code to check character is vowel or not:-
package learn;
import java.util.Scanner;
public class VowelOrNot {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the Charcter");
char c = sc.next().charAt(0);
if(c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' || c=='O' || c=='U' ) {
System.out.println("Charcter is vowel");
}
else {
System.out.println("Character is not vowel");
}
}
}