Didart

Lower Or Upper

May 13th, 2021
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.43 KB | None | 0 0
  1. import java.util.Locale;
  2. import java.util.Scanner;
  3.  
  4. public class LowerOrUpper {
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.  
  8.         String symbol = scanner.nextLine();
  9.  
  10.         if (symbol == symbol.toUpperCase()) {
  11.             System.out.print("upper-case");
  12.         } else if (symbol == symbol.toLowerCase()) {
  13.             System.out.println("lower-case");
  14.         }
  15.     }
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment