Advertisement
veronikaaa86

08. Lower or Upper

May 17th, 2023
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 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 if (Character.isLowerCase(symbol)) {
  14.             System.out.println("lower-case");
  15.         }
  16.  
  17.  
  18. //        if (symbol >= 'A' && symbol <= 'Z') {
  19. //            System.out.println("upper-case");
  20. //        } else if (symbol >= 'a' && symbol <= 'z'){
  21. //            System.out.println("lower-case");
  22. //        }
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement