Java examples for java.lang:char
is char Consonant
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { char c = 'a'; System.out.println(isConsonant(c)); }//www . ja v a2 s.c o m static boolean isConsonant(char c) { return !isVowel(c); } static boolean isVowel(char c) { return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y' || c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U' || c == 'Y'; } }