is char Vowel - Java java.lang

Java examples for java.lang:char

Description

is char Vowel

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        char c = 'a';
        System.out.println(isVowel(c));
    }// w  ww.ja v  a  2 s.c  o  m

    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';
    }
}

Related Tutorials