Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
In this Java program, we'll print uppercase and lowercase alphabets using for loop.
Here is the Java program that prints uppercase alphabets.
Code:
class PrintUppercase {
public static void main(String[] args) {
char ch;
for(ch = 'A'; ch <= 'Z'; ++ch)
System.out.print(ch + " ");
}
}
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
Shown below is the Java program that prints the lowercase alphabets.
Code:
class PrintLowercase {
public static void main(String[] args) {
char ch;
for(ch = 'a'; ch <= 'z'; ++ch)
System.out.print(ch + " ");
}
}
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
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.