Yes, you can do it like this:
for (char alphabet="A"; alphabet <= 'Z'; alphabet++) {
System.out.println(alphabet);
}
It is also possible with typecasting:
for (int i = 65; i <= 90; i++) {
System.out.println((char)i);
}
Yes, you can do it like this:
for (char alphabet="A"; alphabet <= 'Z'; alphabet++) {
System.out.println(alphabet);
}
It is also possible with typecasting:
for (int i = 65; i <= 90; i++) {
System.out.println((char)i);
}