You cannot do this by extending Character
because it is a final class (you cannot extend it), but even if you could, you could not just simply cast for example your character to the subclass (you would had to make a corresponding constructor for example).
You could however try something like:
public class Main {
//Supports only english vowels (uperrcase, or lowercase):
public static boolean isVowel(final int codePoint) {
return "aeiouyAEIOUY".indexOf(codePoint) >= 0;
}
public static void main(final String[] args) {
System.out.println(isVowel('A')); //true.
System.out.println(isVowel('b')); //false.
}
}
but again you will have to define all the vowels of all languages manually (both uppercase and lowercase).
I also checked regexes in Java, but did not find anything about a Vowel class for example.