How to determines whether a character is a uppercase in Java

1 Answer

0 votes
package javaapplication1;
 
public class JavaApplication1 {
 
    public static void main(String[] args) {
 
        char ch = 'a';

        boolean b;
        
        b = Character.isUpperCase(ch);
        System.out.println(b);
        
        System.out.println(Character.isUpperCase('A'));
        System.out.println(Character.isUpperCase('\t'));
        System.out.println(Character.isUpperCase('\n'));
    }
}
 
/*
run:

false
true
false
false
 
*/

 



answered Sep 16, 2016 by avibootz

Related questions

1 answer 172 views
1 answer 153 views
1 answer 180 views
1 answer 194 views
1 answer 198 views
1 answer 213 views
...