Here is Program to find whether entered character is a vowel constant number or a special character
import java.io.*; class stch { public static void main(String [] args) throws IOException { char ch; DataInputStream din=new DataInputStream(System.in); System.out.println("Enter the character: "); ch=(char)(din.read()); switch (ch) { case 'a': case 'e': case 'i': case 'o': case 'u': { System.out.println("The character character is a Vowel."); break; } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { System.out.println("The character entered is a Number."); break; } case 'v': case 'n': case 't': case 'b': case 'r': case 'f': { System.out.println("The character entered is a Special Character."); break; } default: { System.out.println("The character entered is Constant."); break; } } } }
how do u deal with special chars like @#$ in switch case??
how do u deal with special chars like @#$ in switch case??