1.

Check whether a value is uppercase or not

Answer»

To check for uppercase, you need to test the value from ‘A’ to ‘Z’.
Let US see an EXAMPLE:

public class Example {     public static void main(String []args) {        char C = 'B';        if (C >= 'A' && C <= 'Z') {          System.out.println("Uppercase!");        } else {          System.out.println("Lowecase!");        }     } }

The output:

Uppercase!


Discussion

No Comment Found