Advertisement
veronikaaa86

08. Lower or Upper

Sep 21st, 2022
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. package dataTypes;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P08LowerOrUpper {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.  
  9.         char symbol = scanner.nextLine().charAt(0);
  10.  
  11.         if (Character.isUpperCase(symbol)) {
  12.             System.out.println("upper-case");
  13.         } else {
  14.             System.out.println("lower-case");
  15.         }
  16.        
  17. //        if (symbol >= 'A' && symbol <= 'Z') {
  18. //            System.out.println("upper-case");
  19. //        } else {
  20. //            System.out.println("lower-case");
  21. //        }
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement