- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Check whether a character is Uppercase or not in Java
To check whether a character is in Uppercase or not in Java, use the Character.isUpperCase() method.
We have a character to be checked.
char val = 'K';
Now let us use the Character.isUpperCase() method.
if (Character.isUpperCase(val)) { System.out.println("Character is in Uppercase!"); }else { System.out.println("Character is in Lowercase!"); }
Let us see the complete example now to check for Uppercase in Java.
Example
public class Demo { public static void main(String []args) { System.out.println("Checking for Uppercase character..."); char val = 'K'; System.out.println("Character: "+val); if (Character.isUpperCase(val)) { System.out.println("Character is in Uppercase!"); }else { System.out.println("Character is in Lowercase!"); } } }
Output
Checking for Uppercase character... Character: K Character is in Uppercase!
- Related Articles
- Check whether a character is Lowercase or not in Java
- Java Program to Check Whether a Character is Alphabet or Not
- C++ Program to Check Whether a Character is Alphabet or Not
- Check whether a Stack is empty or not in Java
- Check whether a HashSet is empty or not in Java
- Check whether a NavigableMap empty or not in Java
- How to check whether a string is in lowercase or uppercase in R?
- Check whether the file is hidden or not in Java
- Check whether IdentityHashMap empty or not in Java?
- Check whether the entered value is a digit or not in Java
- Check whether the entered value is a letter or not in Java
- Java Program to Check Whether a Number is Prime or Not
- Check whether the Average Character of the String is present or not in Python
- Check whether the entered value is whitespace or not in Java
- How to Check Whether a Number is Krishnamurthy Number or Not in Java?

Advertisements