How can i do this?

Joined
Jan 8, 2022
Messages
11
Reaction score
0
i did that but it didn't work. here is the code

public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
System.out.println("Put in your letter");
char c = reader.next().charAt(0);
if (Character.isUpperCase); {
System.out.println("your letter is uppercase");
} if (Character.isLowerCase); {
System.out.println("Your letter is lowercase");
}
}
 
Joined
Mar 3, 2021
Messages
240
Reaction score
30
Those are functions, the first argument of which is the character to check. E.g.,

Code:
Character.isUpperCase(c)
 
Joined
Jan 24, 2022
Messages
30
Reaction score
2
To check the letter for uppercase or lowercase you need to use the Character. Like for uppercase UpperCase(), method and similar to this for lowercase only change are LowerCase().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top