Advertisement
Guest User

HomeWork 3

a guest
Jul 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1.  
  2.  
  3. public class ThirdAssignment {
  4.     public static void main(String[] args) {
  5.  
  6.         char firstL = 'A'; //declaring first letter
  7.         char lastL = 'Z';//declaring last letter
  8.  
  9.         //subtracting Z and A to see the difference, and Adding 1 to get the exact amount of letter.
  10.         System.out.println("The amount of letters in the  Alphabet is: " + (lastL - firstL + 1));
  11.  
  12.  
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement