Java program to check whether entered character is uppercase or lowercase. This is a Java program that determines whether the given Alphabets are Uppercase, Lowercase, or Digits. Any character can be used as input. After that, we compare the ASCII value of that character to the three cases provided. If that value is the same, the output will be the same. The source code for the Java program to determine whether given Alphabets are Uppercase, Lowercase, or Digits is available here.
public class Main
public static void main(String args) throws IOException
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter any letter");
m = (char) bf.read();
if(m >= 97 && m <= 123)
else if(m >= 65 && m <= 96)
else if(m >= 48 && m <= 57)
Enter any letter g
What is IOExpection in java program
IOException is a checked exception that must be handled correctly by the application developer. That means that if a file is not found when your program is looking for it, an FileNotFoundException will be issued. IOException has a subtype called FileNotFoundException.
To define an exception in Java, use the throws keyword. It informs the programmer that an exception may occur, hence it is preferable for the programmer to write exception handling code in order to maintain regular flow.
What is buffered reader in java program
What is InputStreamReader program in java
An InputStreamReader is a converter between byte and character streams: It reads bytes and converts them to characters with the help of a charset. The charset it uses can be provided explicitly or by name, or the platform’s default charset can be allowed.