create a Java Program to display whether the entered character is in uppercase or lowercase
Answers
Answered by
3
Answer:
public class CharacterDemo {
public static void main(String[] args) {
// create 2 char primitives ch1, ch2
char ch1, ch2;
// assign values to ch1, ch2
ch1 = 'K';
// create 2 boolean primitives b1, b2
boolean b1, b2;
// check if ch1, ch2 are uppercase and assign results to b1, b2
if(Character.isUpperCase(ch1)){
System.out.println("uppercase");
} else {
System.out.println("lowercase");
}
}
Similar questions