You are on page 1of 1

import java.io.

*;

public class CharIsStringOrNum_pAgain_byIfElse


{

public static void main(String[] args)throws IOException


{
char choice;
BufferedReader inp = new BufferedReader(new InputStreamReader(System.in));
do
{
System.out.println("Enter any caracter : ");
//int ch = Integer.parseInt(inp.readLine()); // this will be problem
char ch = inp.readLine().charAt(0);

if(ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z')
{
System.out.println(ch + " is Alphabet");
}
else
{
System.out.println(ch + " is Numerical Value");
}
System.out.println("Do you want to run program again(Y/N)?");
choice = inp.readLine().charAt(0);
}
while(choice == 'Y' || choice == 'y');
inp.close();
}
}

You might also like