Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.
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
Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.
Start Free TestingEarn resume-worthy Selenium certifications that help you land a top job.
Learn MoreTest orchestration and execution cloud of 3000+ browsers and OS
24/7 support
Enterprise grade security
Fastest test execution cloud