title: Java: How to write a program to recognize only uppercase letters using boolean and string
body: <p>I am new to programming and Java. I am having a problem which is to make my program recognize Uppercase letters only and display error message if the user input is non-alphabetic character. I am instructed to use boolean and strings for this problem. 
  Thanks!</p>
  
  <pre><code>Scanner in = new Scanner(System.in);
  System.out.println("Enter a single letter, and I will tell you what the corresponding digit is on the telephone:");
  String letter = in.nextLine();
  String upperCase = letter.toUpperCase();
  boolean letter = letter.hasUpperCase();
  
  
  if (letter.equals("A") || letter.equals("B") || letter.equals("C")){
   System.out.println("The digit 2 corresponds to the letter " + letter + " on the telephone.");
  }
  else if{
    System.out.println("Please enter a letter.")
  }
  </code></pre>