Java Program to Display Characters From A to Z Using Loop

Java Program to Display Characters From A to Z Using Loop. A writing system, or alphabet, is a set of symbols for writing. Letters are the basic symbols in an alphabet. Each letter in the alphabet represents a sound or a group of sounds.

class Main 
{
public static void main(String[] args)
{

char a;
for(a = 'A'; a <= 'Z'; ++a)
System.out.print(a + " ");
}
}

 

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

Java Program to Display Characters From A to Z Using Loop for Developers

A writing system, or alphabet, is a set of symbols for writing. Letters are the basic symbols in an alphabet. Each letter in the alphabet represents a sound or a group of sounds. The Latin alphabet is used in many languages and is the most widely used alphabet today. In this program you can display the alphabets using for loop. 

What is For Loop and How to Implement to Display Alphabets

A for statement in Java creates loops with an automatically maintained counter variable. The for statement allows you to specify an initial value for the counter variable, the amount that will be added to it on each loop execution, and the condition that will be evaluated to determine when the loop should end. Java program to display characters From A to Z using loop for beginners to programming.

What is Char and How to Declare in Java Program

The char keyword in Java refers to a primitive data type. It’s where character-type variables and methods are declared. It has the ability to store unsigned 16-bit Unicode characters. The Character function Object()  can be used to create a Character object: Character ch = new Character(‘a’); In some cases, the Java compiler will create a Character object for you.

Similar Programs