Java Program 18 - Write a Java Program to print Uppercase and Lowercase Alphabets in Java.
//How to print A to Z or a to z alphabets in Java
.
You can loop through A to Z using a for loop because they are stored as ASCII characters in Java.
So, internally, you loop through 65 to 90 to print the English alphabets.
You simply replace 'A' with 'a' and 'Z' with 'z' to display the lowercased alphabets. In this case, interally you loop through 97 to 122.
//How to print A to Z or a to z alphabets in Java
You can loop through A to Z using a for loop because they are stored as ASCII characters in Java.
So, internally, you loop through 65 to 90 to print the English alphabets.
You simply replace 'A' with 'a' and 'Z' with 'z' to display the lowercased alphabets. In this case, interally you loop through 97 to 122.
0 comments:
Post a Comment