Java Program to Display Character from A to Z

In this example, we are giving a program to display character from A to Z.


To display character from A to Z:

  1. # To display character from A to Z
  2. public class Characters {
  3. public static void main(String[] args) {
  4. char c;
  5. for(c = 'A'; c <= 'Z'; ++c)
  6. System.out.print(c + " ");
  7. }
  8. }

Output:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z